Skip to content

Instantly share code, notes, and snippets.

View scriptmediala's full-sized avatar

Script Media LA scriptmediala

View GitHub Profile
@scriptmediala
scriptmediala / repl-client.js
Created November 25, 2015 00:56 — forked from TooTallNate/repl-client.js
Running a "full-featured" REPL using a net.Server and net.Socket
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
@scriptmediala
scriptmediala / bash-cheatsheet.sh
Created November 8, 2015 07:55 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@kkurni
kkurni / kk-example-angularjs-cors
Last active September 25, 2018 18:13
CORS Demo with Angular JS
var AngularJSApp = angular.module("AngularJSApp", ["ngResource", "ngSanitize"])
.config(function ($routeProvider, $httpProvider) {
$routeProvider.
when('/', { controller: NavigationCtrl, templateUrl: 'navigation.html' }).
when('/feedback', { controller: FeedbackCtrl, templateUrl: 'feedback.html' }).
otherwise({ redirectTo: '/' });
$httpProvider.defaults.withCredentials = true;
delete $httpProvider.defaults.headers.common["X-Requested-With"];
@TooTallNate
TooTallNate / bbs.js
Created March 16, 2012 22:42
Running a node.js REPL over `curl`
/**
* Requires node v0.7.7 or greater.
*
* To connect: $ curl -sSNT. localhost:8000
*/
var http = require('http')
, repl = require('repl')
, buf0 = new Buffer([0])
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()