Skip to content

Instantly share code, notes, and snippets.

class Round(object):
def __init__(self, num, num_moves, deactivate_tile):
super(Round, self).__init__()
self.num = num
self.num_moves = num_moves
self.results = []
self.starting_points = []
self.deactivate_tile = deactivate_tile
def move(self, start, num_moves):
.channels-wrap
{ max-width: 0px
; overflow: hidden
; transition: max-width 0s ease-in-out
}
.channels-wrap:hover,
.channels-wrap:focus
{ max-width: 50rem
; transition: max-width 0.3s ease-in-out
@kgleeson
kgleeson / Description.txt
Last active August 29, 2015 14:03
Simple expression
Write a simple parser to parse a formula and calculate the result. Given a string containing only integer numbers, brackets, plus and minus signs, calculate and print the numeric answer. Assume that the formula will always follow correct syntax
Example input:
(2+2)-(3-(6-5))-4
Example output:
-2
modes <- array();
function getWeather()
{
local url = "https://api.forecast.io/forecast/91ee02469ebe1d745f3feed1cb9439d3/53.3331,-6.2489?units=si";
local res = http.get(url, {}).sendsync();
if (res.statuscode != 200)
{
server.log("Forecast.io Error: " + res.statuscode + " => " + res.body);
} else
We couldn’t find that file to show.
@kgleeson
kgleeson / agent.nut
Last active August 29, 2015 13:57
Clock
modes <- array();
function getWeather()
{
local url = "https://api.forecast.io/forecast/XXXXXXXXXXXX/53.3331,-6.2489?units=si";
local res = http.get(url, {}).sendsync();
if (res.statuscode != 200)
{
server.log("Forecast.io Error: " + res.statuscode + " => " + res.body);
} else
@kgleeson
kgleeson / _.md
Created February 9, 2014 23:13
Clock
int LED = D7;
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(250);
digitalWrite(LED, LOW);
class Test():
def __init__(self):
self.a = '1'
c = Test()
print "{a}".format(**c)
print "{a}".format(**c.__dict__)
float temp;
int tempPin = 0;
int ledAnalogOne[] = {3, 5, 6};
const byte RED[] = {255,0,0}; //0
const byte GREEN[] = {0,255,0}; //1
const byte BLUE[] = {0,0,255}; //2
const byte CYAN[] = {0,255,255}; //3
const byte WHITE[] = {255,255,255}; //4
const byte WARMWHITE[] = {253,245,230}; //5