Skip to content

Instantly share code, notes, and snippets.

View griffithben's full-sized avatar
🤔

Ben Griffith griffithben

🤔
View GitHub Profile
@N3MIS15
N3MIS15 / tilt_repeater.ino
Last active January 10, 2024 13:32
ESP32 Tilt Repeater
// ESP32 Tilt Repeater
// By David Gray
#include "BLEDevice.h"
#include "BLEBeacon.h"
#include "esp_deep_sleep.h"
// User Settings
int SCAN_TIME = 5; // Duration to scan for bluetooth devices (in seconds).
int TIME_TO_SLEEP = 60; // Duration ESP32 will go to sleep between scans (in seconds).
@ogrrd
ogrrd / dnsmasq OS X.md
Last active April 16, 2024 20:28
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@ralphschindler
ralphschindler / example.php
Created October 24, 2012 23:18
Zend\Db\Sql\Select example usage
<?php
use Zend\Db\Sql\Select;
// basic table
$select0 = new Select;
$select0->from('foo');
// 'SELECT "foo".* FROM "foo"';
@jamescarr
jamescarr / gist:3660228
Created September 6, 2012 20:42
tests.watchr
##
# run: watchr tests.watchr
##
$exec = "php #{Dir.pwd}/vendor/bin/phpunit.php".
watch('(.*).php') { |m| changed(m[0]) }.
def changed(file).
#ignore file, just run all cases in 'tests/'
@nnnnathann
nnnnathann / gist:3491640
Created August 27, 2012 19:37
Reverse HTTP Proxy (Apache + nodejs)
We couldn’t find that file to show.
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
@matoakley
matoakley / gist:1092571
Created July 19, 2011 14:38
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`