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 | |
/Users/ehalferty/objc/build/bin/clang++ -emit-llvm --target=wasm32 -Oz src/cxx/test.cxx -c -o src/cxx/test.ll | |
llc src/cxx/test.ll -march=wasm32 -filetype=asm -o src/cxx/test.s | |
s2wasm src/cxx/test.s > src/cxx/test.wat | |
wat2wasm src/cxx/test.wat -o src/wasm/test.wasm |
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
// Load some sample WASM. | |
const wasm = require("wasm/test.wasm"); | |
WASMHelper.runWat(wasm); |
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
# Install to home directory | |
cd ~ | |
# Extract the package | |
wget http://mirror.metrocast.net/apache/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gz | |
tar -xf apache-maven-3.1.1-bin.tar.gz | |
# Install mvn to path | |
M2_HOME=$HOME/apache-maven-3.1.1 | |
echo -e "\n# Maven 3.1.1 Setup" >> ~/.bashrc |
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* exampleGenerator(i) { | |
yield i + 1; | |
yield i + 2; | |
yield i + 3; | |
} | |
function run(iter) { | |
let done = false; | |
while (!done) { |
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 ruby | |
require "base64" | |
file_name = ARGV[0] | |
data = File.read file_name | |
puts Base64.encode64 data |
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
(export AWS_ACCESS_KEY_ID=$(ruby -e "require \"json\"; puts JSON.parse(\`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<IAM group>\`)[\"AccessKeyId\"]"); export AWS_SECRET_ACCESS_KEY=$(ruby -e "require \"json\"; puts JSON.parse(\`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<IAM group>\`)[\"SecretAccessKey\"]"); export AWS_SESSION_TOKEN=$(ruby -e "require \"json\"; puts JSON.parse(\`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<IAM group>\`)[\"Token\"]"); export AWS_DEFAULT_REGION="us-east-1"; aws sqs send-message --queue-url "https://sqs.us-east-1.amazonaws.com/<rest of queue URL>" --message-body "Test") |
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
alias unescape='ruby -e "require \"uri\";puts URI::unescape ARGV[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
# in config/initializers/disable_sprockets_cache_in_dev.rb | |
if Rails.env.development? | |
module Rails | |
class Application | |
def assets | |
@assets ||= Sprockets::Environment.new(root.to_s) do |env| | |
env.version = ::Rails.env | |
path = "#{config.root}/tmp/cache/assets/#{::Rails.env}" |
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
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c\n" | |
#define BYTE_TO_BINARY(val) \ | |
(val & 0x80 ? '1' : '0'), \ | |
(val & 0x40 ? '1' : '0'), \ | |
(val & 0x20 ? '1' : '0'), \ | |
(val & 0x10 ? '1' : '0'), \ | |
(val & 0x8 ? '1' : '0'), \ | |
(val & 0x4 ? '1' : '0'), \ | |
(val & 0x2 ? '1' : '0'), \ | |
(val & 0x1 ? '1' : '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
#!/usr/bin/env ruby | |
require 'socket' | |
require 'json' | |
server = TCPServer.new '0.0.0.0', 8765 | |
loop do | |
socket = server.accept | |
data = "" | |
while (line = socket.gets) && line != "\r\n" | |
data += line | |
end |