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 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 | |
# Runs an acquia task, and waits for the task to complete before continuing. | |
# This is a helper script, to be used in others as needed. | |
if [[ $1 = "" ]] || [[ $2 = "" ]] | |
then | |
echo "Runs an acquia drush command, waiting for the results before continuing." | |
echo "Can be used as a replacement for drush." | |
echo | |
echo " Usage: $0 <site-alias> <ac-drush-command>" |
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 extname = require('path').extname; | |
var Metalsmith = require('metalsmith'); | |
var myth = require('myth'); | |
var http = require('http'); | |
var templates = require('metalsmith-templates'); | |
var markdown = require('metalsmith-markdown'); | |
var watch = require('metalsmith-watch'); | |
/** |
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 python | |
# Quick and dirty demonstration of CVE-2014-0160 by | |
# Jared Stafford (jspenguin@jspenguin.org) | |
# Modified so that it finds cookies | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
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
{ | |
"@context": { | |
"ex": "http://example.com", | |
"ex:customer": { | |
"@type": "@id" | |
}, | |
"ex:quantity": { | |
"@type": "xsd:integer" | |
}, | |
"ex:price": { |
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
// Intallation: | |
// npm install jsdom jquery | |
var jsdom = require('jsdom'); | |
jsdom.env('http://google.ca/', null, function (err, window) { | |
$ = require('jquery').create(window); | |
$('a').each(function () { | |
console.log($(this).attr('href'), ' ---> ', $(this).text()); | |
}); |
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
function onOpen() { | |
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}]; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
ss.addMenu("Fitness Diaries", menuEntries); | |
} | |
function createDocFromSheet(){ | |
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id | |
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries | |
// get the data from an individual user |
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
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |