#Mac OS X
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
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:math="http://exslt.org/math" | |
extension-element-prefixes="math"> | |
<xsl:template name="makeHash"> | |
<xsl:param name="length">8</xsl:param> | |
<xsl:param name="count" select="$length"/> | |
<xsl:param name="hash"/> | |
<xsl:variable name="possibleFirst">xABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</xsl:variable> |
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
import Prelude hiding (head) | |
import Data.Enumerator | |
import Control.Monad.IO.Class | |
sum1 :: [Int] -> Int | |
sum1 [] = 0 | |
sum1 (x:xs) = x + sum xs | |
getNumber :: IO (Maybe Int) | |
getNumber = do |
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
// Given a simplified module pattern like so: | |
(function(APP, $, _) { | |
APP.MyWidget = function(opts) { | |
var self = {}; | |
var defaults = { | |
// an array of contexts and declarative event bindings | |
bindings : [ | |
{ |
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
<macrodef name="install-helper"> | |
<sequential> | |
<echo>Killing the running app...</echo> | |
<exec executable="${adb}" failonerror="true"> | |
<arg line="${adb.device.arg}" /> | |
<arg value="shell" /> | |
<arg value="killall" /> | |
<arg value="${manifest.package}" /> | |
</exec> | |
<echo>Uninstalling previous version for clean slate...</echo> |
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
.PHONY: all clean test | |
DATA_REPEATS?=1000 | |
DATA_FILE?=/usr/share/dict/words | |
GHC_OPTS?=-fspec-constr-count=64 -funfolding-use-threshold=64 | |
all: wce wci | |
clean: | |
rm -f wce wci *.hi *.o |
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 'nokogiri' | |
require 'uri' | |
module FeedTags | |
def absolute_url(url, base='/') | |
return url if url.match /^(javascript|data):/ | |
root = @context.registers[:site].config['home'] | |
URI.join(root, base, url).to_s | |
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
(defun su/magit/format-magit-status-buffer-name () | |
"Append the value of current branch to `magit-status' buffer" | |
(let ((magit-status-buffer-name (buffer-name (magit-find-status-buffer))) | |
(branch-name (magit-get-current-branch)) | |
(buffer-name-regex "^\\(\\*.*\\*\\)\\(.*\\)?$")) | |
(dolist (buffer-name `(,magit-status-buffer-name ,magit-log-buffer-name)) | |
(string-match buffer-name-regex buffer-name) | |
(ignore-errors (with-current-buffer buffer-name | |
(rename-buffer (replace-match (concat "\\1" (format |
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 'url) | |
(defun get-and-parse-json (url) | |
(interactive) | |
(with-current-buffer (url-retrieve-synchronously url) | |
(goto-char (point-min)) | |
(re-search-forward "^$") | |
(json-read))) | |
(defun get-movie-json (title &optional year) |
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 | |
# Summary: | |
# Bash script repoints all inbound access for a given AWS EC2 security group | |
# to your current IP addr(v4) as provided by ifconfig.me/ip | |
# To use this script: | |
# Pass the name of a security group as a command line argument | |
# e.g. $ aws_repoint_to_my_ip.sh SECURITYGROUPNAME |
OlderNewer