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
li#grades_menu_item { | |
display: none; | |
visibility: none; | |
} |
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
// CGContextABCD(context!, ...) becomes context?.ABCD(...) | |
import Cocoa | |
extension CGContext { | |
func saveGState() { CGContextSaveGState(self) } | |
func restoreGState() { CGContextRestoreGState(self) } | |
func scaleCTM( sx: CGFloat, sy: CGFloat) { CGContextScaleCTM(self, sx, sy) } | |
func translateCTM( tx: CGFloat, ty: CGFloat) { CGContextTranslateCTM(self, tx, ty) } | |
func rotateCTM( angle: CGFloat) { CGContextRotateCTM(self, angle) } |
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
AWS = require "aws-sdk" | |
https = require "https" | |
creds = | |
accessKeyId: "<<ACCESS KEY ID>>" | |
secretAccessKey: "<<SECRET ACCESS KEY>>" | |
opts = | |
method: "GET" | |
pathname: -> '/restapis' |
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
crypto = require "crypto" | |
chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
module.exports = ( size = 40 ) -> | |
throw "bad size" if size < 1 | |
key = "" | |
bytes = crypto.randomBytes( size * 3 ) | |
j = 0 | |
while key.length < size |
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
#set($root = $input.path('$')) | |
#set($res = {"method":"$context.httpMethod", "resource":"$input.params('resource')", "requestId":"$context.requestId" }) | |
#set( $optional = ["Authorization", "X-MyApp-Api-Token"]) | |
#foreach ($x in $optional) | |
#if ($input.params($x).length() > 0) | |
#set( $res[$x.toLowerCase()] = $input.params($x)) | |
#end |
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
pseq = ( arr ) => arr.reduce( | |
( r, n ) => r.then( typeof n === 'function' ? n : () => Promise.resolve( n ) ), | |
Promise.resolve() ); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Disabled</key> | |
<false/> | |
<key>EnvironmentVariables</key> | |
<dict> | |
<key>PATH</key> | |
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin</string> |
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
object IterableExtSpec : Spek({ | |
val list = (0 until 100).toList() | |
describe("splitAt") { | |
it("asserts when n < 0") { | |
assertFailsWith<IllegalArgumentException> { | |
list.splitAt(-2) | |
} | |
} |
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 MovingAverageWithRate(object): | |
""" | |
Computes the moving average (with optional sample rate) of supplied | |
samples over a given window size. | |
Add new samples with add() | |
""" | |
def __init__(self, window_size): |
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 .system-font-stack { | |
font-weight: 200 !important; | |
font-family: "mplus-1c-light" !important; | |
font-size: 12px !important; | |
color: #748FB4 !important; | |
} | |
.js-app .js-column .stream-item .js-tweet-text { | |
color: #748FB4 !important; | |
} |