Skip to content

Instantly share code, notes, and snippets.

View griffithben's full-sized avatar
🤔

Ben Griffith griffithben

🤔
View GitHub Profile
@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`
@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')
@nnnnathann
nnnnathann / gist:3491640
Created August 27, 2012 19:37
Reverse HTTP Proxy (Apache + nodejs)
We couldn’t find that file to show.
@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/'
@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"';
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active October 26, 2024 07:45
A badass list of frontend development resources I collected over time.
@ogrrd
ogrrd / dnsmasq OS X.md
Last active October 30, 2024 18:37
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

@N3MIS15
N3MIS15 / tilt_repeater.ino
Last active September 4, 2024 22:07
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).