Skip to content

Instantly share code, notes, and snippets.

View lerouxb's full-sized avatar

Le Roux Bodenstein lerouxb

View GitHub Profile
@iluvcapra
iluvcapra / cycloid_gear.scad
Last active May 20, 2023 01:30
OpenSCAD cycloid gear
function epicycloid(t, rmaj, rmin) = [ (rmaj+rmin) * cos(t) - rmin * cos(((rmaj+rmin)/rmin)*t),
(rmaj+rmin) * sin(t) - rmin * sin(((rmaj+rmin)/rmin)*t) ];
function hypocycloid(t, rmaj, rmin) = [ (rmaj-rmin) * cos(t) + rmin * cos(((rmaj-rmin)/rmin)*t),
(rmaj-rmin) * sin(t) - rmin * sin(((rmaj-rmin)/rmin)*t) ];
module CycloidTooth(
rmaj = 30,
rmin = 20,
circ_pitch = 10.0,
@sr75
sr75 / wildcard-ssl-cert-for-testing-nginx-conf.md
Created June 1, 2013 18:35
create a self signed wildcard ssl cert for testing with nginx.conf example

just change out app_name for your purposes

openssl genrsa 2048 > app_name-wildcard.key

openssl req -new -x509 -nodes -sha1 -days 3650 -key app_name-wildcard.key > app_name-wildcard.cert

# Common Name (eg, your name or your server's hostname) []:*.app_name.com

openssl x509 -noout -fingerprint -text < app_name-wildcard.cert > app_name-wildcard.info
@uberEllis
uberEllis / JohnLennon.php
Last active December 17, 2015 03:59
A doodle in PHP
<?php
function word_live_as_one($imagination) {
global $world;
foreach ($imagination as $thought) {
switch ($thought) {
case 'heaven':
case 'hell':
case 'countries':
case 'possessions':
$dreamer = FALSE;
@AndrewRadev
AndrewRadev / indent.vim
Created April 3, 2012 19:26
Two useful text objects for coffeescript
" See http://andrewradev.com/2012/04/03/manipulating-coffeescript-with-vim-part-1-text-objects/
" for details on the implementation
onoremap ii :<c-u>call <SID>IndentTextObject()<cr>
onoremap аi :<c-u>call <SID>IndentTextObject()<cr>
xnoremap ii :<c-u>call <SID>IndentTextObject()<cr>
xnoremap ai :<c-u>call <SID>IndentTextObject()<cr>
function! s:IndentTextObject()
let upper = s:UpperIndentLimit(line('.'))
let lower = s:LowerIndentLimit(line('.'))
@rhussmann
rhussmann / SignInWithTwitter.js
Created September 6, 2010 06:05
Simple 'sign in with Twitter' implementation in node.js
var http = require('http'),
sys = require('sys'),
URL = require('url'),
querystring = require('querystring'),
OAuth = require('oauth').OAuth;
var oa = new OAuth('https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
'YOUR APP CONSUMER KEY HERE',
'YOUR APP CONSUMER SECRET HERE',