start new:
tmux
start new with session name:
tmux new -s myname
source "http://rubygems.org/" | |
gem "sinatra", "~> 1.3.0" | |
gem "thin" |
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
html | |
{ | |
/* Set background image so that transparency is easy to see */ | |
background: #fff url(http://uhaweb.hartford.edu/CASS/unicorn.jpg) fixed no-repeat; | |
} | |
#container |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
$('#search').keyup(function () { | |
var searchField = $('#search').val(); | |
if (searchField.length) | |
{ | |
var myExp = new RegExp(searchField, "i"); | |
var found = 0; | |
$.getJSON('data.json', function (data) { | |
var output = '<ul class="searchresults">'; |
/* | |
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674 | |
*/ | |
var fs = require('fs'); | |
// string generated by canvas.toDataURL() | |
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0" | |
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" | |
+ "3gAAAABJRU5ErkJggg=="; | |
// strip off the data: url prefix to get just the base64-encoded bytes |
brew install openssl | |
brew link --force openssl | |
gem install puma | |
ALternatively: | |
export CPPFLAGS="-I/usr/local/opt/openssl/include" | |
export LDFLAGS="-L/usr/local/opt/openssl/lib" | |
gem install puma |