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
| public extension UIImage { | |
| /** | |
| Example: | |
| ``` | |
| UIImage.animationSequence(withPattern: "0XX_animation_images", swapMatching: "XX", numberOfImages: 60) | |
| ``` | |
| @param base The base string on which the animation image sequence will be generated. Note: Must have *match* embeded inside. | |
| @param match: The pattern contained in pattern that will be substituted. | |
| @param count: number of images to be generated. Note: Must be less than or equal to log 10 of match length. |
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
| func dispatchOnce(_ predicate: inout Bool, _ block: @noescape () throws -> Void) rethrows { | |
| objc_sync_enter(predicate) | |
| defer { objc_sync_exit(predicate) } | |
| if predicate == false { | |
| defer { predicate = true } | |
| try block() | |
| } | |
| } |
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
| # Made by Kai Aldag on September 30, 2015 | |
| # Imports | |
| import RPi.GPIO as GPIO | |
| import sys | |
| import time | |
| # Setup | |
| GPIO.setmode(GPIO.BOARD) |
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 Foundation | |
| enum Position { | |
| case Over | |
| case Under | |
| } | |
| extension Comparable { |
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
| # !/bin/bash | |
| clear | |
| echo fear no more $USER, we are here to help | |
| echo | |
| echo Killing Xcode processes | |
| kill $(ps aux | grep 'Xcode' | awk '{print $2}') | |
| echo done |
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 urllib2 | |
| from urllib2 import urlopen | |
| import re | |
| import bs4 | |
| from bs4 import BeautifulSoup | |
| import cookielib, urllib2 | |
| from cookielib import CookieJar | |
| import datetime | |
| import xml.etree.ElementTree as ET | |
| from xml.etree.ElementTree import Element, tostring, SubElement |
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
| class Calculator | |
| def addition | |
| print "please enter the first number you want to add: " | |
| number1 = gets.chomp | |
| puts number1 | |
| print "please enter the secound number: " | |
| number2 = gets.chomp |
NewerOlder