Skip to content

Instantly share code, notes, and snippets.

View danesparza's full-sized avatar
:octocat:
The best way to predict the future is to invent it - Alan Kay

Dan Esparza danesparza

:octocat:
The best way to predict the future is to invent it - Alan Kay
View GitHub Profile
@tnmt
tnmt / wp-xml-octopress-import.rb
Created November 15, 2011 12:31
Import XML of Wordpress to Octopress
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jbuchbinder
jbuchbinder / gorilla_auth.go
Created June 19, 2013 18:22
Gorilla mux + basic authentication from htpasswd file
package main
import (
auth "github.com/abbot/go-http-auth"
"github.com/gorilla/mux"
"log"
"net/http"
"time"
)
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@erichurst
erichurst / US Zip Codes from 2013 Government Data
Created December 9, 2013 23:00
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
@bryanbarnard
bryanbarnard / SimpleHttpClient.cs
Created December 23, 2013 19:15
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net;
namespace HTTP_Test
@Daniel15
Daniel15 / dialog.js
Created January 8, 2014 18:17
Bootstrap dialog in React
var Dialog = React.createClass({
getInitialState: function() {
return {
className: 'modal fade'
};
},
show: function() {
this.setState({ className: 'modal fade show' });
setTimeout(function() {
this.setState({ className: 'modal fade show in' });
@insin
insin / BootstrapModalMixin.js
Last active February 5, 2021 07:47
A Bootstrap (3) modal mixin for React / MIT License
/** @jsx React.DOM */
var BootstrapModalMixin = function() {
var handlerProps =
['handleShow', 'handleShown', 'handleHide', 'handleHidden']
var bsModalEvents = {
handleShow: 'show.bs.modal'
, handleShown: 'shown.bs.modal'
, handleHide: 'hide.bs.modal'
@ajfisher
ajfisher / _readme.md
Last active November 21, 2023 16:28
Auto WiFi detection and hotspot creation in boot for RPI

Auto WiFi detection or wifi hostpot creation during boot for RPI

Note: These are rough notes and there may be some variance as versions of raspbian get updated but should be pretty reliable as a guide.

This gist provides some instructions and config in order to have your Raspberry PI automatically connect to a roamed network, however if it fails to discover an available network it will set itself up as a wireless access point for you to connect to.

@colinf
colinf / sbf_AppStore.js
Last active July 13, 2016 16:09
Flux Store class in ES6 ( See http://bit.ly/29RY6gq )
import FluxStore from './FluxStore';
import AppDispatcher from '../dispatcher/AppDispatcher';
import {ActionTypes} from '../constants/AppConstants';
let appState;
function reset() {
appState = {};
}