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
<!-- Parent --> | |
<div ng-class="{true: ‘these classes when true’, false: ‘these classes when false’}[variable]"> | |
<!-- Child --> | |
<button ng-click="variable = !variable">Toggle me bro</button> | |
</div> | |
<!-- Shorthand when just toggling visibility --> | |
<div ng-toggle="variable"> | |
<!-- Child --> | |
<button ng-click="variable = !variable">Toggle me bro</button> |
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 math | |
NUMBER_WORDS = { | |
1 : "one", | |
2 : "two", | |
3 : "three", | |
4 : "four", | |
5 : "five", | |
6 : "six", | |
7 : "seven", |
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 Car { | |
Door leftDoor, rightDoor; | |
Wheel leftFrontWheel, leftRearWheel, rightFrontWheel, rightRearWheel; | |
Car() { | |
Door leftDoor = new Door(true, false); | |
Door rightDoor | |
// other constructor things... | |
rightDoor.open(); |
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
NICE GRAYS | |
---------------------------- | |
black: #000 | |
darker gray: #222 | |
dark gray: #333 | |
gray: #555 | |
light gray: #999 | |
lighter gray: #eee | |
white: #fff |
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
# Disable the startup message | |
startup_message off | |
# create a status line at the bottom of the screen. this will show the titles and locations of | |
# all screen windows you have open at any given time | |
hardstatus alwayslastline "%{= dR} %-Lw%50>%{= dG}%n%f* %{= dW}%t%{= dR}%+Lw%<" | |
# bind some function keys (k1 == F1, etc) for fast navigation through screen windows | |
# | |
# | |
# use F8 to turn the status bar off at the bottom of the screen | |
bindkey -k k8 hardstatus alwayslastline |
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 ddf.minim.*; | |
Minim minim; | |
AudioInput in; | |
int counter; | |
void setup() | |
{ | |
size(1024, 768, P2D); |
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
# Downloads all the tiles at full resolution from a directory of Zoomify tiles. | |
# Requires `eventlet` for multithreaded HTTP requests | |
import eventlet | |
from eventlet.green import urllib2 | |
from math import floor, ceil, pow | |
BASE_URL = "http://www.theatlantic.com/media/interactives/2015/11/colorado-satellite-photo/tiles/" | |
DOWNLOAD_DIR = "tiles/" |
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
<html> | |
<head> | |
<title>Email Form</title> | |
</head> | |
<body> | |
<form action=""> | |
<input type="text" placeholder="Email"> | |
<input type="submit"> | |
</form> |
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 | |
import requests | |
import json | |
MAKER_EVENT_TITLE = "raspi_connected" | |
MAKER_CHANNEL_KEY = "<your key>" | |
def connect_type(word_list): | |
""" This function takes a list of words, then, depeding which key word, returns the corresponding | |
internet connection type as a string. ie) 'ethernet'. |
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
license: gpl-3.0 |
OlderNewer