Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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 brainfuck(code,input){ | |
var pc = 0; | |
var sysout = []; | |
var sysin = input.split('').reverse(); | |
var ptr = 0; | |
var data = [0]; | |
var size = code.length; | |
var program = code.split('') | |
var loops = []; |
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
export RUBY_HEAP_MIN_SLOTS=1250000 | |
export RUBY_HEAP_SLOTS_INCREMENT=100000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_GC_MALLOC_LIMIT=30000000 | |
export RUBY_HEAP_FREE_MIN=12500 |
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
window.setInterval(function(){ | |
document.getElementsByClassName('action-endorse')[~~(Math.random() * 4)].click() | |
}, 5000); | |
//paste this into javascript console when the 4 tile DOES __ KNOW ABOUT __? ENDORSE! dialog appears on linked in. | |
//they don't seem to be grepping for robots so no need to randomize the interval | |
//will run until they run out of recent recommendations. click around a bit and it will come up again. |
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 String | |
def |(other) | |
other.call(*self) | |
end | |
def >(other) | |
File.write(other, *self) | |
0 | |
end | |
end |
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 stream = tmpStream(function(filename, stat, cb) { | |
// do stuff | |
// when done call cb which will unlink filename | |
// plus emit 'finish' on stream (or 'error' if called with an error) | |
}) | |
stream.write('hello world') | |
stream.end() | |
stream.on('finish', function() { |
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
Turning The Design Clock Back | |
Object-oriented design principles haven't had the effect we hoped for. The | |
SOLID principles are excellent design guidelines, but experience shows that | |
programmers find them difficult to follow. What do we do about this? | |
Surprisingly, the Structured Design literature of forty years ago contains | |
compelling solutions to many current design problems. They're simple and easy | |
to understand, but were lost in the noise as OO rose to popularity. We'll | |
reinterpret these simple design ideas in a modern context, finding that many of | |
our most promising new design ideas resemble them. Rapid web application |
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
Turning The Metal Clock Back | |
Forge-driven metal principles haven't had the effect we hoped for. The | |
NORCAL principles are excellent metal guidelines, but experience shows that | |
metallurgists find them difficult to follow. What do we do about this? | |
Surprisingly, the Structured metal literature of two months ago contains | |
compelling solutions to many current metal problems. They're simple and easy | |
to understand, but were lost in the noise as TDD rose to popularity. We'll | |
reinterpret these simple metal ideas in a modern context, finding that many of | |
our most promising new metal ideas resemble them. Rapid reverse-forge driven |
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 test = require('tap').test; | |
var tests = require('./tests.js'); | |
tests(test); |
PhantomJS is an awesome tool for doing automated, full-stack acceptance tests in a headless browser. It's a great alternative to capybara-webkit because it doesn't depend on QT or xvfb, and it's way better than Selenium in most cases because it's faster (you don't need to open Firefox to run your tests).
Unfortunately, installing PhantomJS via Homebrew can wreak havoc on your Rubies if you're using rbenv. These are the steps that worked for me in fixing my Ruby installations.
# Update Homebrew
brew update
# Install PhantomJS