This file contains hidden or 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
{ | |
"directory": "build/vendor/" | |
} |
This file contains hidden or 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 window.Slider | |
constructor: (selector, @options)-> | |
@index = 0 | |
@elements = document.querySelectorAll selector | |
@prevIndex = @elements.length - 1 | |
@setupOptions() | |
@changeActive(@index) | |
@startInterval() |
This file contains hidden or 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
function getTransformationMatrix(rotation, scale, translateX, translateY){ | |
var matrix = [scale * Math.cos(rotation), scale * Math.sin(rotation), | |
-scale * Math.sin(rotation), scale * Math.cos(rotation), | |
translateX, translateY] | |
return matrix.join(", ") | |
} |
This file contains hidden or 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
/* | |
Use like | |
{key: "value"}.map((object, key) => { console.log(key) }) | |
*/ | |
if (typeof Object.prototype.map != 'function') { | |
Object.prototype.map = function(callback) { | |
'use strict'; | |
if (this == null) { | |
throw new TypeError('Cannot convert undefined or null to object'); | |
} |
This file contains hidden or 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 http = require('http'); | |
var fs = require('fs'); | |
var dataFile = './data.json'; | |
var dataURL = 'http://www.ombord.info/api/jsonp/position/'; | |
var errorHandling = (e) => { | |
console.log(`Got error: ${e.message}`); | |
fetchData(); | |
} |
This file contains hidden or 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/sh | |
# Script for quickly swicthing MAC-adress on SJ trains! | |
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z | |
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') | |
networksetup -detectnewhardware | |
networksetup -setairportnetwork en0 "SJ" |
This file contains hidden or 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
use std::collections::VecDeque; | |
use std::fs::File; | |
use std::io::{self, BufRead}; | |
const PREAMBLE_LENGTH: usize = 25; | |
fn has_sum_makers(sum: u64, preamble: Vec<u64>) -> bool { | |
assert_eq!(preamble.len(), PREAMBLE_LENGTH); | |
for a in &preamble { | |
for b in &preamble { |
OlderNewer