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
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:time]; | |
[UIView setAnimationDelay:0]; | |
[UIView setAnimationCurve:UIViewAnimationCurveLinear]; | |
[UIView commitAnimations]; |
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
-- PRAGMAs | |
PRAGMA foreign_keys = ON; | |
-- User | |
CREATE TABLE account( | |
id TEXT PRIMARY KEY, | |
user_id TEXT UNIQUE NOT NULL, | |
password TEXT NOT NULL, | |
password_reset_code TEXT NULL, | |
email TEXT UNIQUE NOT NULL, |
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
package ca.mitmaro.cs4751.a03; | |
public class Vector { | |
public static class Vector2D extends Vector { | |
public Vector2D(Vector v) { | |
this(v.components[Vector.X], v.components[Vector.Y]); | |
} | |
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
mkdir website.jekyll | |
cd website.jekyll | |
mkdir _layouts _posts | |
touch _layouts/default.md | |
touch _posts/2000-01-01-title1.md _posts/2000-01-02-title2.md | |
cat > index.html << EOF | |
--- | |
layout: default | |
--- | |
EOF |
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 localStorageActionCreator = function(flux, store) { | |
var _timerId = null; | |
// only way I can think to get the dispatcher into the timer actions | |
// which are not real actions | |
var _dispatch = flux.dispatchBinder.dispatch; | |
// force save every little bit in case this storage object doesn't get a chance | |
// to save | |
setInterval(_persistData, 60 * 1000); |
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
// some number that when 360 * precision * 100 + 50 * precision won't overflow an integer | |
// number of positions after the decimal to keep | |
var digits = 4; | |
var precision = Math.pow(10, digits); | |
function combine(x, y, maxydigits) { | |
x = Math.floor(x * precision); | |
y = Math.floor(y * precision); | |
var maxy = Math.pow(10, maxydigits) * precision; | |
return x * maxy + y; |
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
// wrong | |
if (true) { | |
someLongFunctionName(/*somelong item like this that requires a second line*/, | |
/*some other item */); | |
} | |
// correct | |
if (true) { | |
someLongFunctionName(/*somelong item like this that requires a second line*/, | |
/*some other item */); |
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
node_modules |
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
// ==UserScript== | |
// @name BitBucket tab size | |
// @namespace http://mitmaro.ca | |
// @version 1.0.0 | |
// @description Converts the diff tab size on BB | |
// @author Tim Oram | |
// @match https://bitbucket.org/*/*/pull-requests/*/diff | |
// @grant none | |
// ==/UserScript== |
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 | |
SCRIPTROOT="$( cd "$(dirname "$0")" ; pwd -P )" | |
for f in "$@"; do | |
NEWFILE="${f:0:${#f} - 4}js" | |
gsed -f "$SCRIPTROOT/jsonToModule.script" "$f" > "$NEWFILE" | |
rm "$f" | |
done |