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
| 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
| 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
| 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
| 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
| 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
| - (void)onTapped:(UITapGestureRecognizer*)gesture { | |
| self.currentPage = (self.currentPage+1) % self.numberOfPages; | |
| [self setNeedsDisplay]; | |
| [self sendActionsForControlEvents:UIControlEventValueChanged]; | |
| } |
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
| new Crafty.polygon([379,562],[772,560],[785,547],[783,531],[381,531],[379,543]), | |
| new Crafty.polygon([186,526],[293,522],[297,556],[186,561],[175,544]), | |
| new Crafty.polygon([817,362],[805,385],[781,403],[751,418],[712,421],[696,318],[749,307],[777,321],[806,338]), | |
| new Crafty.polygon([219,189],[796,189],[807,197],[809,208],[802,221],[787,230],[218,224],[206,215],[206,205]), | |
| new Crafty.polygon([635,550],[713,457],[781,520],[784,543],[778,556]), | |
| new Crafty.polygon([709,412],[709,479],[731,480],[731,412]), | |
| new Crafty.polygon([620,226],[699,294],[785,218]), | |
| new Crafty.polygon([679,280],[704,347],[749,327],[722,263]), | |
| new Crafty.polygon([91,55],[997,52],[997,14],[95,25]), | |
| new Crafty.polygon([261,688],[935,688],[934,726],[262,718]), |
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
| var serverSide = (typeof module !== "undefined"); | |
| if (serverSide) { | |
| var Canvas = require('canvas') | |
| , Image = Canvas.Image | |
| , fs = require('fs'); | |
| } | |
| function HeroImage() { | |
| var height = 620; |
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
| var Canvas = require('canvas') | |
| , Image = Canvas.Image | |
| , canvas = new Canvas(400, 400) | |
| , ctx = canvas.getContext('2d') | |
| , fs = require('fs') | |
| var sprite | |
| var hairSprite |