This file contains 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 |
This file contains 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 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 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 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 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 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 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 UIKit | |
import CoreImage | |
extension UIImage { | |
/** Returns an Array of all detected faces as *UIImages.* If none are found empty Array will be returned. | |
- Author: Kai Aldag | |
*/ | |
func findFacesInImage() throws -> [UIImage] { |
This file contains 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
# Script for breaking HackMIT challenge 2 | |
import requests | |
import threading | |
fail = ''' | |
<html> | |
<head> | |
<title>Hack Store</title> | |
<link href="https://fonts.googleapis.com/css?family=Poppins:400,700" rel="stylesheet"> |
This file contains 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
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
internal final class StarView: UIView { | |
let numberOfEdges = 5 | |
let fillColor: UIColor = .red | |
let strokeColor: UIColor = .black | |
let lineWidth: CGFloat = 2 |
OlderNewer