Skip to content

Instantly share code, notes, and snippets.

View tuefekci's full-sized avatar

Giacomo Tüfekci tuefekci

View GitHub Profile
@jrsinclair
jrsinclair / php-full-depth-case-insensitive-file-exists.php
Created July 19, 2013 05:17
PHP Full-depth Case Insensitive file_exists() Function
<?php
/**
* Single level, Case Insensitive File Exists.
*
* Only searches one level deep. Based on
* https://gist.github.com/hubgit/456028
*
* @param string $file The file path to search for.
*
* @return string The path if found, FALSE otherwise.
@BonsaiDen
BonsaiDen / namegen.js
Last active August 26, 2020 08:42
Planet Name Generator thing
function NameGenerator(state) {
// Syllables shamelessly stolen from elite
var syllables = 'folexegezacebisousesarmaindirea.eratenberalavetiedorquanteisrion',
vocals = 'aeiou';
// Some improvements
var vocalMustFollow = 'tdbr',
notFollowdBySelf = 'rstie',
onlyAtStart = 'xyz',
@wolfeidau
wolfeidau / networks.md
Created April 30, 2013 08:38
Bunch of commands to slow data into and out of an OSX host

Simulating slow networks

In this case I am testing slowing down traffic to 173.192.57.100 for http and https traffic.

sudo ipfw add pipe 1 ip from any to 173.192.57.100 out dst-port 443
sudo ipfw add pipe 1 ip from any to 173.192.57.100 out dst-port 80

Apply a bandwidth restriction of 10KB/sec on the pipe assocated with the previously listed rules.

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

@tamboer
tamboer / jquery_find_hover.js
Created April 30, 2013 07:42
jQuery table row tr hover
$(document).ready(function(){
$('.hover').hide();
$('tr').hover(
//over
function(){
$(this).find('.hover').show();
}
,
//out
@ArnaudBan
ArnaudBan / px_to_em.scss
Last active December 16, 2015 19:39
Compass fonction to always work in em easily
@function px_to_em( $value, $context : 16 ){
@return ( $value / $context ) + 0em ;
}
@tomi77
tomi77 / main.js
Created April 20, 2013 19:30
RequireJS "main config file" for Bootstrap
require.config({
paths: {
'bootstrap-affix': '../vendors/bootstrap/js/bootstrap-affix',
'bootstrap-alert': '../vendors/bootstrap/js/bootstrap-alert',
'bootstrap-button': '../vendors/bootstrap/js/bootstrap-button',
'bootstrap-carousel': '../vendors/bootstrap/js/bootstrap-carousel',
'bootstrap-collapse': '../vendors/bootstrap/js/bootstrap-collapse',
'bootstrap-dropdown': '../vendors/bootstrap/js/bootstrap-dropdown',
'bootstrap-modal': '../vendors/bootstrap/js/bootstrap-modal',
'bootstrap-popover': '../vendors/bootstrap/js/bootstrap-popover',
@agmcleod
agmcleod / timer-melonjs.js
Created December 6, 2012 15:35
Timer example melonjs
App = {
load: function() {
if(!me.video.init("app", 800, 600, false, 1.0)) {
alert("Your browser does not support the canvas.");
return;
}
me.loader.onload = this.loaded.bind(this);
me.loader.preload([]);
me.state.change(me.state.LOADING);
@konsumer
konsumer / index.html
Created October 26, 2012 12:32
Load Flare levels in melonjs
<!DOCTYPE html>
<html>
<head>
<title>Iso Demo</title>
<style>
html, body {
padding:0;
margin:0;
}
#framecounter {
@kucrut
kucrut / nav-menu-item-custom-fields.php
Created September 29, 2012 15:39 — forked from westonruter/nav-menu-item-custom-fields.php
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(