Skip to content

Instantly share code, notes, and snippets.

View tywrr's full-sized avatar

Ty tywrr

  • SF, CA
  • 04:15 (UTC -07:00)
View GitHub Profile
This file has been truncated, but you can view the full file.
Processes: 679 total, 5 running, 674 sleeping, 3774 threads
2025/02/10 15:57:12
Load Avg: 3.28, 2.11, 2.83
CPU usage: 11.27% user, 22.18% sys, 66.54% idle
SharedLibs: 924M resident, 185M data, 141M linkedit.
MemRegions: 370828 total, 6459M resident, 1078M private, 3103M shared.
PhysMem: 22G used (1860M wired, 408M compressor), 1491M unused.
VM: 294T vsize, 8608M framework vsize, 0(0) swapins, 0(0) swapouts.
Networks: packets: 0/0B in, 0/0B out.
Disks: 0/0B read, 0/0B written.
@tywrr
tywrr / csv2json.go
Created August 17, 2017 07:09
golang csv2json
package main
import (
"encoding/csv"
"encoding/json"
"fmt"
"os"
"strconv"
)
@tywrr
tywrr / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
filetype off " Required for vundle
set shell=bash " Make vim friendly with fishshell
set encoding=utf-8 " Set default encoding to UTF-8
set noswapfile
set nobackup " Never let vim write a backup file, they did that in the 70's
@tywrr
tywrr / server
Created April 1, 2013 21:36
Take a screen shot of a website, resize it, and emit it back to the client.
// Error checking taken out for brevity
io.sockets.on('connection', function(client){
client.on('capture', function (url) {
var webshotOptions = {
screenSize: { width: 620, height: 620 },
shotSize: { width: 620, height: 620 }
},
pageObj = {},
@tywrr
tywrr / challenge1.rb
Created May 27, 2012 20:38
Challenge 1 in the forums from Ruby Core at rubylearning.org
def age(sec)
years_float = sec.to_f / 60 / 60 / 24 / 365
years_int = sec / 60 / 60 / 24 / 365
months = (years_float - years_int) * 12
puts "I'm #{years_int} years and #{months.to_i} months old."
end
age 979000000
age 2158493738
age 2461144023