Skip to content

Instantly share code, notes, and snippets.

View rchrd2's full-sized avatar

Richard Caceres rchrd2

View GitHub Profile
@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: {
@rchrd2
rchrd2 / yaml2dot.py
Created April 21, 2016 05:45
YAML to Graphviz
#!/usr/bin/python
# vim: fileencoding=utf-8
u'''Translate YAML written text to graphviz dot language
Input YAML text like below:
---
foo:
@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 / hello-backbone-react.js
Created February 17, 2016 18:46
Using React with Backbone
var HelloView = Backbone.View.extend({
initialize: function() {
this.listenTo(this.model, "change", this.render, this);
this.render();
},
render: function() {
var reactEl = React.createElement('div', {}, 'Hello, World!');
ReactDOM.render(reactEl, this.el);
return this;
}
@rchrd2
rchrd2 / html5-template.html
Last active February 16, 2016 23:56
Barebones html5 template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Hello</title>
<!--<link href="style.css" rel="stylesheet">-->
<style>
@rchrd2
rchrd2 / fix-camera.sh
Created October 19, 2015 21:27
fix isight camea
sudo killall VDCAssistant
/**
* jQuery plugin to add a faux browser around some images
* Based off of http://cloudcannon.com/deconstructions/2014/11/21/flat-css-browser-wrapper.html
*
* Example usage:
*
* <body>
* <img class="fakeBrowser" src="http://example.com/image.jpg"
* </body>
*
### Keybase proof
I hereby claim:
* I am rchrd2 on github.
* I am rchrd2 (https://keybase.io/rchrd2) on keybase.
* I have a public key whose fingerprint is A166 5BE1 E8F6 A2A3 BEC7 382A 8CCA 345A 01E9 EF4B
To claim this, I am signing this object:
@rchrd2
rchrd2 / Toaster_AI_v2.c
Last active April 12, 2023 17:34
Toaster_AI_v2.pd
// Toaster AI v2
// by Richard Caceres
// 11/12/09
//
// Safety Precautions that could be put in place
// Overheating
// Description: Precautions to prevent the toaster from being on too long.
// Status: A solution is put in place where the toaster can only be on N seconds at a time.
// There is also a cool down period.
//
@rchrd2
rchrd2 / .bash_profile
Created May 21, 2015 19:16
Disable pyc files!
# Add this to your ~/.bash_profile
# Disable pyc
export PYTHONDONTWRITEBYTECODE=x