Skip to content

Instantly share code, notes, and snippets.

151.859507ms audio 121
161.878684ms audio 121
171.838729ms audio 121
181.788916ms audio 121
191.833415ms audio 121
201.781046ms audio 121
211.774527ms audio 121
221.781544ms audio 121
231.819408ms audio 121
241.818812ms audio 121
# Lifted from https://news.ycombinator.com/item?id=14305084
% cat test.rs
fn main() {
println!("Hello, world!");
}
% rustc --emit llvm-bc -C lto test.rs
% LIB=$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib
% xcrun --toolchain XcodeDefault clang -o test test.bc ~/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-ea49ffd3fee5264c.rlib
warning: overriding the module target triple with x86_64-apple-macosx10.12.0 [-Woverride-module]
package com.bschwind.bottombarnativetest;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
gfdagadf
readFile("filename.txt", function(err, data) {
console.log("5 seconds have elapsed");
if (err) { return; }
readFile("otherfile.txt", function(err, data) {
console.log("10 seconds have elapsed");
if (err) { return; }
writeFileToNetwork(data, function(err, response) {
if (err) { return; }
console.log("complete");
"use strict";
var BUCKET_NAME = process.env.BUCKET;
var crypto = require("crypto");
var jwt = require("jsonwebtoken");
var logger = require("services/logger").getLogger("general");
var mime = require("mime-types");
var moment = require("moment");
var uuid = require("node-uuid");
@bschwind
bschwind / gist:8495883
Created January 18, 2014 20:32
Building a stroke tree for a particular character
package com.skritter.utils;
import com.skritter.models.Param;
import com.skritter.models.Stroke;
import com.skritter.models.StrokeData;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
find . -name *.png -o -name *.jpg -exec cp {} . \;
@bschwind
bschwind / NetworkBuffer.cs
Created April 14, 2012 01:46
Network Buffer for organizing network stream data
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GraphicsToolkit.Networking
{
/// <summary>
/// This class helps organize the data required for
/// reading and writing to a network stream
@bschwind
bschwind / Server.cs
Created April 14, 2012 01:44
Implements a simple TCP server with one thread per client
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Collections.Concurrent;
namespace GraphicsToolkit.Networking