Skip to content

Instantly share code, notes, and snippets.

@mythz
mythz / xhr.js
Created November 2, 2011 19:05
Standalone jQuery-like Ajax Client
//Adds $.xhr and jQuery-like $.ajax methods to the prescribed namespace.
//Inspired from David Flanagans excellent cross-platform utils http://www.davidflanagan.com/javascript5/display.php?n=20-1&f=20/01.js
//Includes underscore.js _.each and _.extend methods
//modified to behave like jQuery's $.ajax(), not complete.
(function($) {
var win=window, xhrs = [
function () { return new XMLHttpRequest(); },
function () { return new ActiveXObject("Microsoft.XMLHTTP"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP.3.0"); },
function () { return new ActiveXObject("MSXML2.XMLHTTP"); }
@steveclarke
steveclarke / gist:1411146
Created November 30, 2011 21:54
Git: Setting up a Remote Repository and Doing Initial Push

Setup remote repository:

ssh [email protected]
mkdir my_project.git
cd my_project.git
git init --bare

On local machine:

cd my_project

@tmcw
tmcw / index.html
Created November 2, 2012 00:34
MapBox.js With SVG Markers
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
#marker {
position:absolute;
@riccardoscalco
riccardoscalco / README.md
Last active July 22, 2022 16:32
Confidence intervals on linear regression

Confidence intervals on linear regression

Python code for the evaluation of linear regression and confidence intervals between two random variables x and y.

@Guitlle
Guitlle / gscope.c
Created April 18, 2013 22:48
Osciloscopio para la launchpad MSP430 con el chip msp430g2553. Tiene 8 velocidades y funciona vía el puerto seria (UART) para que funcione deben voltear los JUMPERs que dicen TX y RX (hardware uart). A 9600 baudios por segundo, se le envía un caracter y la launchpad responde con 200 datos obtenidos mediante el ADC . Requiere que el cristal que t…
#include "msp430g2553.h"
#include "stdbool.h"
#define LED BIT6
#define RXD BIT1
#define TXD BIT2
unsigned int i; // for loop variable
volatile unsigned char rx_flag = 0;
volatile unsigned char tx_flag = 0;
@wookietreiber
wookietreiber / default.pa
Created November 29, 2015 10:44
stream with ffmpeg, pulseaudio.
# To record both mic and other audio input sources we need to add a named output sink. See:
# http://www.linuxquestions.org/questions/linux-software-2/alsa-and-pulseaudio-recording-multiple-input-devices-877614/
# http://www.youtube.com/watch?v=oJADNOY615Y&feature=player_embedded
# Add this to your /etc/pulse/default.pa file
load-module module-null-sink sink_name=stream
load-module module-loopback latency_msec=5 sink=stream
load-module module-loopback latency_msec=5 sink=stream
@snurhussein
snurhussein / PSPPConvert.md
Last active October 31, 2021 23:49
Using PSPP to convert sav files to csv

#Converting SPSS files to csv with PSPP#

Install and open PSPP Use the File menu to open your file (it probably has a .sav extension) Go to File>New>Syntax to open PSPP's command line window

Enter:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@darwing1210
darwing1210 / wordpress_fabfile.py
Last active August 9, 2019 23:29
A Python Fabfile to deploy a wordpress site over SSH
import os
from time import time
from fabric.api import sudo, run, task, env, cd, get, local
from fabric.context_managers import shell_env
env.hosts = ['yourhost']
env.user = 'yoursshuser'
env.password = 'yoursshpassword'
# env.key_filename = '~/yourkey.pem'
@AlexArcPy
AlexArcPy / shp2geojson.py
Created July 28, 2017 09:52
Convert shapefile to GeoJSON with ogr and Python
import json
import ogr
driver = ogr.GetDriverByName('ESRI Shapefile')
shp_path = r'C:\GIS\Temp\Counties.shp'
data_source = driver.Open(shp_path, 0)
fc = {
'type': 'FeatureCollection',
'features': []