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
(module | |
(export "main" (func $main)) | |
;; Create memory with at least 1 page of 64k of memory | |
(memory $mem 1) | |
(func $main (result i32 i32) | |
;; write some data to an arbitrary memory location | |
i32.const 0xcafe ;; address | |
i32.const 42 ;; memory to write |
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
(module | |
;; Create a function that returns a single value | |
(func $main (result i32) | |
i32.const 42 | |
) | |
;; Export that function so the test harness can find it | |
(export "main" (func $main)) | |
) |
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
'use strict'; | |
const Promise = require('bluebird'); | |
const DBus = require('dbus'); | |
const Bus = require('dbus/lib/bus'); | |
const Interface = require('dbus/lib/interface'); | |
Promise.promisifyAll(Bus.prototype); | |
Promise.promisifyAll(Interface.prototype); |
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 | |
# Format the current date in a way that clearly shows local time and UTC time, | |
# for use in a tmux status bar. | |
# Examples: | |
# tmux-date (with computer set to America/Chicago timezone) | |
# 2016-01-11 / 08:55 -06:00 / 14:55Z | |
# TZ="Australia/Victoria" tmux-date | |
# 2016-01-12 / 01:55 +11:00 / 2016-01-11T14:55Z |
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 | |
set -e | |
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" | |
short_current_branch=${current_branch#refs/heads/} | |
date=$(date --iso-8601 --date="-1 month") | |
options=() |
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
// | |
// UserAgent.swift | |
// | |
import Foundation | |
class UserAgent { | |
static func getUserAgent() -> String { | |
let bundleDict = NSBundle.mainBundle().infoDictionary! | |
let appName = bundleDict["CFBundleName"] as! String |
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
<?php | |
$d = new DateTime("2012-10-11"); | |
function unalteredFormat($date, $locale) { | |
$fmt = new IntlDateFormatter( | |
$locale, | |
IntlDateFormatter::SHORT, | |
IntlDateFormatter::NONE); | |
$fmtted = $fmt->format($date); |
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 | |
sizes=('29' '29@2' '29@3' '40' '40@2' '40@3' '60@2' '60@3' '76' '76@2') | |
IFS='@' | |
for size in "${sizes[@]}" | |
do | |
read -ra parts <<< "$size" | |
base=${parts[0]} |
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
{!-- | |
> Awesome. Just had an Ah-ha! moment. Build small blocks, then add | |
> multiple Block fields to a channel with specific blocks in. | |
-- @JayHealy, https://twitter.com/JayHealey/status/598668322301837312 | |
--} | |
{cf_page_content} |
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
# ... | |
# Open up WAMP's Apache httpd.conf in Sublime, so I can add a vhost | |
alias vhosts='/c/Program\ Files/Sublime\ Text\ 2/sublime_text.exe /c/wamp/bin/apache/apache2.4.2/conf/httpd.conf' | |
# Restart WAMP's Apache to pick up vhost changes | |
alias apacherestart='NET STOP wampapache && NET START wampapache' | |
# Edit the hosts file | |
alias hosts='vi /c/Windows/System32/drivers/etc/hosts' |
NewerOlder