This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git log --pretty=format:"- %s" --decorate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| platform :ios, '5.0' | |
| pod 'AFNetworking', '1.1.0' | |
| pod 'AdMob', '6.2.1' | |
| pod 'HockeySDK', '3.0.0' | |
| pod 'Facebook-iOS-SDK', '3.2.1' | |
| pod 'StyledPageControl', '1.0' | |
| pod 'BSKeyboardControls', '2.0' | |
| pod 'GoogleAnalytics-iOS-SDK', '2.0beta4' | |
| pod 'AFHTTPRequestOperationLogger', '0.10.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| label.textColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.55]; | |
| label.shadowColor = [UIColor blackColor]; | |
| label.shadowOffset = CGSizeMake(0.0,-1.0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input_file = 'input.jpg' | |
| output_file = 'output.jpg' | |
| def mutate(line) | |
| line[rand(line.length-1)] = "0" | |
| end | |
| File.open(input_file,'r') do |input| | |
| File.open(output_file,'w') do |output| | |
| while line = input.gets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fizz_or_buzz = fn | |
| (0, 0, _) -> "FizzBuzz" | |
| (0, _, _) -> "Fizz" | |
| (_, 0, _) -> "Buzz" | |
| (_, _, x) -> "#{x}" | |
| end | |
| Enum.each 10..16, fn n -> | |
| IO.puts fizz_or_buzz.(rem(n, 3), rem(n, 5), n) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Chop do | |
| def guess(actual, a..b) do | |
| mid = midpoint(a, b) | |
| IO.puts "Is it #{mid}?" | |
| compare actual, a..b, mid | |
| end | |
| defp compare(actual, _.._, current) when current == actual do | |
| IO.puts "Got it! It was #{actual}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Enum | |
| # build a deck of cards | |
| deck = lc rank inlist '23456789TJQKA', suit inlist 'CDHS', do: [suit, rank] | |
| # -> ['C2', 'D2', 'H2', 'S2', 'C3', 'D3', ... ] | |
| # take 5 random cards from the deck | |
| hand = deck |> shuffle |> take(5) | |
| # -> ['D8', 'CQ', 'H2', 'H3', 'HK'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I think the one-electron theory is my favourite physics theory. It's something I was taught that's come around on Hacker News recently https://en.wikipedia.org/wiki/One-electron_universe | |
| **It involves a thought experiment.** | |
| Imagine making jelly *(jello, if you're in the states)* with a load of string looped around, bundled, and set in it like a big suspended knot. Taking a cross-section of the jello will show a load of identical dots. They're seemingly un-connected, but _we know there's just one string they came from_. | |
| Now extrapolate this out and imagine that the jelly is space-time, and any slice is our 3D world at a given time. Because we're bound by time we can only see one slice at a time. It seems to us that there are always a lot of identical dots - and we naturally assume each is a separate thing. | |
| The one-electron theory asks whether this could be how we're perceiving electrons. Could there be one electron whizzing about space and time. At any given time, it would appear to us in multiple places |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| w=console.log.bind(console),t=13,l=0,s=function(b,c){return new Array(b).join(c)}; | |
| f=function(){clear();l=!l;w('\u001B[2J\u001B[0;0f');w(s(t-1,' ')+(l?'\\ /':''));w(s(t-3,' ')+(l?'-->*<--':' .')); | |
| for(i=1;i<t;i++){w(s(t-i,' ')+'/'+s(i,'_'+(i%2?'/':'\\'))+'_\\')}w(s(t-2,' ')+'[___]');setTimeout(f,600)};f() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| currentLocale = 'en'; | |
| locales = { | |
| en: { | |
| 'common.between': 'less than __ but more than __' | |
| } | |
| }; | |
| t = function(key, ...insertions) { | |
| let translatedString = locales[currentLocale][key]; | |
| return translatedString.replace(/__/g, () => insertions.shift()); |