Skip to content

Instantly share code, notes, and snippets.

View rjcorwin's full-sized avatar

R.J. (Steinert) Corwin rjcorwin

  • Khan Academy
  • Burlington, VT
View GitHub Profile
@fideloper
fideloper / update_curl.sh
Last active January 11, 2024 15:23
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@jeffwhelpley
jeffwhelpley / gist:2d14a615790af18b3549
Last active July 13, 2018 11:48
Using window object in Angular 2
// interface for Window
interface Window {
// add some stuff here
}
let someMockWindowObject = {
// add some mock functionality here
};
@bkozora
bkozora / lambdaAMIBackups.py
Last active February 13, 2025 04:27
AWS Lambda AMI Backups
# Automated AMI Backups
#
# @author Bobby Kozora
#
# This script will search for all instances having a tag with the name "backup"
# and value "Backup" on it. As soon as we have the instances list, we loop
# through each instance
# and create an AMI of it. Also, it will look for a "Retention" tag key which
# will be used as a retention policy number in days. If there is no tag with
# that name, it will use a 7 days default value for each AMI.
@tdd
tdd / angular-just-say-no.md
Last active December 18, 2024 15:33
Angular: Just Say No

Angular: Just say no

A collection of articles by AngularJS veterans, sometimes even core committers, that explain in detail what's wrong with Angular 1.x, how Angular 2 isn't the future, and why you should avoid the entire thing at all costs unless you want to spend the next few years in hell.

Reason for this: I'm getting tired of having to explain to everyone, chief of which all the indiscriminate Google Kool-Aid™ drinkers, why I have never believed in Angular, why I think it'll publicly fail pretty soon now (a couple years), and why it's a dead end IMO. This gist serves as a quick target I can point people to in order not to have to parrot / compile the core of the articles below everytime. Their compounded reading pretty much captures 99% of my view on the topic.

This page is accessible through http://bit.ly/angular-just-say-no and http://bit.ly/angularjustsayno, btw.

# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@hlung
hlung / How to connect PS3 controller to a Mac or PC.md
Last active July 22, 2024 21:41
How to connect PS3 controller to a Mac or PC

How to connect PS3 controller to a Mac or PC

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

@jardix22
jardix22 / 1.html
Last active March 6, 2017 16:09 — forked from mxriverlynn/1.html
Modal Bootstrap 3 + Marionette.js
<script id="modal-view-template" type="text/html">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
@rjcorwin
rjcorwin / backbone-models-for-couchdb-boiler-plate.js
Last active December 18, 2015 03:19
The bare minimum you must do to get Backbone.js Models to work with CouchDB.
var SomeModelClass = Backbone.Model.extend({
idAttribute: "_id",
url: function() {
if (_.has(this, 'id')) {
var url = (_.has(this.toJSON(), '_rev'))
? this.server + '/' + this.db + '/' + this.id + '?rev=' + this.get('_rev') // For UPDATE and DELETE
: this.server + '/' + this.db + '/' + this.id // For READ
}

Hi, all.

Encouraged by my successful experiment with a Node.js view server, I am now working on a branch, nodejs_couchdb, with the following properties:

  • Remove couchjs from the project
  • Remove dependency on SpiderMonkey, libjs, 1.8.whatever...all that is gone
  • Remove dependency on libcurl
  • (Thus, simplified autoconf version dependency Hell)

Phase 1: Dependency on a "couchjs" executable which you install via npm install couchjs

@treehouse-su
treehouse-su / cloneRPI.sh
Last active December 11, 2015 16:19
Cloning the SDcard of the raspberry pi while running remotely ... (second SDcard is attached usb SDcard-Reader)
#copy your ssh key to root@raspberrypi
ssh [email protected] 'aptitude install screen'
ssh [email protected] 'screen -d -m -S clone'
ssh [email protected] 'echo u > /proc/sysrq-trigger'
ssh [email protected] 'screen -x clone'
dd if=/dev/mmcblk0 bs=1M of=/dev/sda count=4K
#for the first 4GB
#detach with "CRTL-a d"