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
@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 = {};
}
@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' });
@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])
@agrippa1994
agrippa1994 / playground.swift
Created January 4, 2016 22:05
Bonjour Discovery OS X iOS
import Foundation
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
extension NSData {
func castToCPointer<T>() -> T {
let mem = UnsafeMutablePointer<T>.alloc(sizeof(T.Type))
self.getBytes(mem, length: sizeof(T.Type))
return mem.move()
@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"
)
@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'
@kos59125
kos59125 / logrus_cloudwatchlogs.go
Created August 7, 2016 14:29
github.com/Sirupsen/logrus hook for logging to CloudWatch Logs
package logrus_ext
import (
"encoding/json"
"fmt"
"github.com/Sirupsen/logrus"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
"github.com/oleiade/lane"
@deergod1
deergod1 / pfSense config.md
Last active April 5, 2023 10:39
pfSense Easy Configuration Guide for HP t620 Plus

pfSense Simple Home Configuration - 2.4.3 / 2.4.4

Starting from Scratch

This is my personal guide for installing pfSense. Hope you find it useful. I made these notes to capture the details of my "install from scratch" to ensure I didn't miss important details. Also, I'm trying build my network with discrete "disposable" components that make the system mutable and less rigid. It does not cover installing any packages like Squid or Suricata as that's way beyond the scope of a basic, functional install.

I migrated from an environment that was at various times running Tomato Toastman 1.28 or Asuswrt-Merlin on Netgear and ASUS routers across four "access points" (one always acting as the firewall/gateway, the rest as APs). It was OK pre-gigabit, but had roaming problems, and I was using large Wifi routers with most of the features disabled. Also, I found that I could easily swamp the network and tank VOIP and Wifi Calling without even trying. The only fix was to throttle everything by using Bandwidth Limit

@mcandre
mcandre / apple-bluetooth-keyboard-windows-10-bootcamp.md
Created June 14, 2016 18:12
How to fix Apple Bluetooth Wireless Keyboard (Windows 10)

The driver situation with Apple Bluetooth wireless keyboards and Windows 10 is horrible, even with the latest BootCamp drivers. Fortunately, a workaround is available, if you're patient.

Pair keyboard once

  1. Turn on the keyboard.
  2. Press and hold Command + w until the keyboard light begins blinking, indicating the keyboard is ready to pair.
  3. Use Windows Bluetooth settings to pair the keyboard, entering the same code (e.g. 123456 Enter) on both internal and external keyboards.

Pairing the keyboard is very trial and error. 9/10 times, Windows will complain that the keyboard is not available for pairing. Just keep trying.

@stesie
stesie / index.html
Created April 1, 2016 22:28
AWS IoT-based serverless JS-Webapp Pub/Sub demo
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>AWS IoT Pub/Sub Demo</title>
</head>
<body>
<h1>AWS IoT Pub/Sub Demo</h1>
<form>
<button type="button" id="connect">connect!</button>