Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rchrd2's full-sized avatar

Richard Caceres rchrd2

View GitHub Profile
@rchrd2
rchrd2 / freeway-2600.asm
Last active October 20, 2017 06:50
Honking & collision sound are redacted
; Disassembly of roms/Freeway (1981) (Activision).a26
; Disassembled Thu Oct 19 22:17:47 2017
; Using DiStella v3.01a
;
; Command Line: ./binaries/osx/distella -pafs roms/Freeway (1981) (Activision).a26
;
processor 6502
VSYNC = $00
VBLANK = $01
@rchrd2
rchrd2 / add_swap.sh
Last active August 12, 2017 01:18
Create memory swap (virtual memory) on ubuntu
sudo swapon -s
free -m
df -h
# 2G, 4G, etc
sudo fallocate -l 2G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
ls -lh /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
PS1="$ "
alias pserve="python -m SimpleHTTPServer"
# show git branch in prompt
export PS1="(\$(git branch 2>/dev/null | grep '^*' | colrm 1 2))\$ "
source /usr/local/etc/bash_completion.d/git-completion.bash
# http://unix.stackexchange.com/a/48113
@rchrd2
rchrd2 / newlog.py
Last active June 2, 2017 17:28
newlog
#!/usr/bin/python3
"""
The idea is to take stdin, and write it to a new unique log file
php myscript.php | newlog filename
"""
import os
import sys
@rchrd2
rchrd2 / upload_site.sh
Created April 5, 2016 01:02
Neocities Upload
#!/bin/bash
# Neocities provies an API for uploading files from ./public_html to your site
#
# Example Usage:
# $ USERNAME=username PASS=secret_pass bash upload_site.sh
function upload_file {
fullName=$1
shortName=${fullName:2}
@rchrd2
rchrd2 / stdin2www
Last active January 7, 2017 19:31 — forked from cwarden/stdin2www.sh
Show stdin in a web browser (for Mac OS X)
#!/bin/sh
# read from stdin, write to a temp file, open the temp file in a browser, then delete it
tmpfile=$(mktemp).html; cat > $tmpfile; open $tmpfile; #rm $tmpfile
@rchrd2
rchrd2 / rproxy.conf
Last active December 27, 2016 01:07
NGINX CLI – how to start nginx as a process
error_log /dev/stderr;
events {}
http {
#access_log /dev/stdout;
access_log /dev/null;
server {
listen 8066;
server_name _;
location / {
proxy_pass http://rchrd.net;
@rchrd2
rchrd2 / screenrc
Last active December 24, 2016 20:20
great screenrc config - /etc/screenrc
# Jeff McCune <jeff@puppetlabs.com>
# 2010-07-30
# GNU Screen configuration file
defutf8 on
defflow off
vbell off
autodetach on
startup_message off
defscrollback 10000
@rchrd2
rchrd2 / lorum-ipsum
Last active June 17, 2016 17:22
lorum ipsum command. place in /usr/local/bin and "chmod +x /usr/local/bin/lorum-ipsum"
#!/usr/local/bin/python
print """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam volutpat velit lorem, a aliquet mi egestas sit amet. Aliquam vitae mauris sit amet enim pellentesque consequat. Maecenas et nisi massa. Donec mi justo, mattis et tellus nec, elementum porttitor libero. Ut a lacus vitae orci mollis suscipit. Maecenas ullamcorper ligula in eros facilisis, et hendrerit neque sollicitudin. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec et quam quis metus ullamcorper dignissim. Nullam faucibus at nulla vel imperdiet. Ut nec pharetra eros. Aliquam erat volutpat. Curabitur sem diam, cursus ultricies velit non, placerat consequat velit.
Integer ut arcu id felis consectetur ultrices. Fusce ac augue ligula. Integer tempor lobortis posuere. Nam magna quam, efficitur varius blandit vitae, vulputate a diam. Suspendisse eu turpis aliquet ligula molestie commodo id consectetur lorem. Curabitur ornare, turpis vitae commodo hendrerit, sapien just
@rchrd2
rchrd2 / Gruntfile.js
Created May 4, 2016 01:22
Example gruntfile for react
module.exports = function(grunt) {
grunt.initConfig({
watch: {
files: [
'src/**/*.js',
'src/**/*.jsx'
],
tasks: ['browserify']
},
browserify: {