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
#!/usr/bin/env bash | |
# This script is intended to create a sentry release and upload build artefacts | |
# so we can get better error messages with the sourcemaps and such. | |
# | |
# https://docs.sentry.io/clients/javascript/sourcemaps/#uploading-source-maps-to-sentry | |
# | |
organization=false | |
project=false |
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
#include <iostream> | |
using namespace std; | |
int main(int argc, const char *argv[]) { | |
double n = 3; | |
double result = 1; | |
double multiplier = -1; | |
for (int approximations = 0; approximations < 10000; approximations++) { |
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
type Request = {url: String, payload: String} | |
data Response = | |
Success Number String | Error Number String | |
let ajaxRequest = { | |
return: \x -> x | |
bind: \(x : Request) f -> | |
let r = $.get x.url x.payload | |
r.done (\d s -> f (Success s d)) | |
r.fail (\d s -> f (Error s d)) |
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
data Measurement = | |
Centimetres Number | Inches Number | |
let toInches (x: Measurement) = match x | |
case (Inches _) = x | |
case (Centimetres y) = Inches (y / 2.54) | |
let printMeasurement (x: Measurement) = match x | |
case (Inches n) = console.log n "inches" | |
case (Centimetres n) = console.log n "cm" |
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
;; Recursive anonymous functions! | |
(defn y-combinator | |
[f] | |
((fn [x] (f (fn [v] ((x x) v)))) | |
(fn [x] (f (fn [v] ((x x) v)))))) | |
;; Factorial function using the y-combinator | |
(def fact | |
(y-combinator | |
(fn [partial] |
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
#include <pololu/orangutan.h> | |
#define RIGHT_STICK_V 0 | |
#define RIGHT_STICK_V_MIN 3000 | |
#define RIGHT_STICK_V_MAX 4500 | |
#define LEFT_STICK_V 1 | |
#define LEFT_STICK_V_MIN 3000 | |
#define LEFT_STICK_V_MAX 4500 |
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
myAngularApp.directive('imgLoadStatus', [ | |
'$q', | |
'$timeout', | |
function($q, $timeout){ | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
scope.imagesLoaded = false; | |
// Having this in a timeout sucks, but it won't work without it |