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
#include <Keypad.h> | |
const byte ROWS = 4; | |
const byte COLS = 4; | |
char keys[ROWS][COLS] = { | |
{ | |
'1','2','3','A' } | |
, | |
{ | |
'4','5','6','B' } |
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
var numbers = [] //Array of numbers | |
var range = 100 // Maximum number | |
for (var i = 0; i < range; i++) { | |
numbers.push(Math.round(Math.random()*range)); | |
} | |
blue_color_shade = function (range,number) { | |
var ratio = 255/range; | |
var shade = Math.round(number*ratio).toString(16) |
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
change_color = function(color){ | |
var color = "#03ffc5" | |
var num = parseInt(color,16) | |
var num = parseInt(color.slice(color.length-2,color.length),16); | |
num = num + 50; | |
if(num>255){num = num-255;} | |
return color.slice(0,color.length-2)+num.toString(16) | |
} |
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
var usernames = [PFUser]() | |
var currentUser = PFUser.currentUser() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
var query = PFUser.query() | |
query?.findObjectsInBackgroundWithBlock({ (objects, error: NSError?) -> Void in | |
if error == nil{ | |
for username in objects as Array!{ | |
if(self.currentUser?.objectId != username.objectId){ |
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
var intString = "10" | |
var numberInt = intString.toInt() | |
var numberString = "10.1" | |
var numberDouble = (numberString as NSString).doubleValue | |
var numberFloat = NSString(string: numberString).floatValue |
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
sentence = "soijasdoijasdiojfuhfuhsdfhoscaroijasdoijasdijd" | |
n = sentence.length | |
key = "oscar" | |
l = key.length | |
i = 0 | |
while i < n do | |
j = 0 | |
puts sentence[i] |
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
def get_word(num) | |
teen = "teen" | |
case num | |
when 0; return "o' clock" | |
when 1; return "one" | |
when 2; return "two" | |
when 3; return "three" | |
when 4; return "four" | |
when 5; return "five" | |
when 6; return "six" |
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
//"YYYY-MM-DD hh:mm" | |
function zeroFill(i){ | |
return (i<10 ? '0' : '') + i; | |
} | |
var getDate = function(){ | |
var d = new Date(); | |
var year = d.getFullYear(); | |
var month = zeroFill(d.getMonth()) | |
var day = zeroFill(d.getDate()) |
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 subprocess | |
raw_location = subprocess.check_output("whereami", shell=False) | |
raw_location = raw_location.split() | |
lat = raw_location[1] | |
lon = raw_location[3] | |
hashtag = "#latlon"+lat+"__"+lon | |
command = "echo "+ "\'" + hashtag + "\' | pbcopy" | |
p = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE) | |
p.stdin.write(hashtag) | |
p.stdin.close() |
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
var getFristImage = function(content) { | |
var el = document.createElement( 'html' ); | |
el.innerHTML = content; | |
return el.getElementsByTagName( 'img' )[0].src;; | |
}; |
OlderNewer