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
stateful = (value, state) -> | |
bind = (operation) -> | |
stateful(operation.call(bind, value), bind.state) | |
bind.value = value | |
bind.state = state | |
bind | |
p = stateful(3, "This is the state")((i) -> ++i)((i) -> this.state += "altered"; i * 10)((i) -> i + 2) | |
console.log("Value: " + p.value + "; state: " + p.state); |
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
# Check CoffeeScript | |
square = (x) -> x * x | |
puts "'2' squared: #{square 2}" | |
# See if underscore.coffee is loaded | |
puts "underscore version: #{_.VERSION}" |
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
@model MyNamespace.Models.EditViewModel | |
<div> | |
<h1>Hello world</h1> | |
<span class="foo">@Model.Bar</span> | |
</div> |
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 poll = function(){ | |
window.scrollTo(0, document.body.scrollHeight); | |
setTimeout(function(){ poll() }, 500); | |
}; | |
poll(); |
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
(ns insane-noises.core (:use [overtone.live] | |
[overtone.inst.synth])) | |
(def metro (metronome 64)) | |
(def chords [[:C3 :E3 :G3 :B3] [:F3 :A3 :C3 :E4]]) | |
(defn play-chord [chord] (doall (map (fn [n] (mooger n :amp 0.9)) (map note chord)))) | |
(defn chord-player | |
[beat pids] |
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
require 'twitter' | |
require 'pry' | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = "" | |
config.consumer_secret = "" | |
config.access_token = "" | |
config.access_token_secret = "" | |
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
#################################################### | |
# Post install for Manjaro XFCE Edition | |
# Do not run this as a shell script | |
#################################################### | |
## Install essentials | |
sudo pacman -S vim git curl | |
git config --global core.editor "vim" | |
## Install rvm (ruby) |
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
/* | |
hinclude.js -- HTML Includes (version 0.9.5) | |
Copyright (c) 2005-2012 Mark Nottingham <mnot@mnot.net> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
<!-- Put this code before the first hinclude or in the <head> element --> | |
<script> | |
<!-- https://gist.github.com/egeorjon/6755681 --> | |
document.documentElement.className = document.documentElement.className.replace( /(?:^|\s)no-script(?!\S)/g , '' ) | |
</script> | |
<style> | |
hinclude:not(.included) { | |
visibility: hidden; | |
} |
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
window.loadScripts = function(scripts){ | |
var src; | |
var script; | |
var pendingScripts = []; | |
var firstScript = document.scripts[0]; | |
// Watch scripts load in IE | |
function stateChange() { | |
// Execute as many scripts in order as we can | |
var pendingScript; |