Skip to content

Instantly share code, notes, and snippets.

View sdrib's full-sized avatar
:octocat:
I may be slow to respond.

sdrib

:octocat:
I may be slow to respond.
View GitHub Profile
@judge2020
judge2020 / Aworker.js
Created May 8, 2019 01:59
Cloudflare Workers: block proxy IPs
// Using a global variable so we aren't
// pulling from the proxy API on each
// and every subsequent request
// (note that the Workers billing still applies here)
//
// This could be "truly global" with KV but
// it's not really needed here unless the proxy list
// starts blocking CF ips.
//
//
@p2or
p2or / blender-filebrowser-display-override.py
Last active May 21, 2023 18:07
Override File Browser Display Settings (http://blender.stackexchange.com/q/23159/3710) #Blender #BSE
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@tbrianjones
tbrianjones / Inflect.php
Last active February 21, 2024 21:28
A PHP Class for converting English words between Singular and Plural.
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
@bomberstudios
bomberstudios / sketch-plugins.md
Last active July 16, 2025 18:21
A list of Sketch plugins hosted at GitHub, in no particular order.
@Bio2hazard
Bio2hazard / BasicController.php
Created August 31, 2013 01:28
A benchmark on Doctrine 2 and: No caching, caching via useResultCache(true) and caching with explicitly specifying a cache ID.
<?php
namespace Talis\SwiftForumBundle\Controller;
use Doctrine\ORM\EntityManager;
use Talis\SwiftForumBundle\Controller\BaseController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class BasicController extends BaseController
{
private $start;
private $pause_time;
@ponderomotion
ponderomotion / Makefile
Created March 7, 2013 00:02
Generic C++ Makefile for SDL on Mac OSX
SHELL = /bin/sh
CXX = g++
FFLAGS = -g
TARGET = my_executable
OBJDIR = obj
SRCDIR = src
BINDIR = bin
@lachie
lachie / blackmesa.sh
Created September 16, 2012 06:10
Run black mesa on mac
#!/bin/bash
#
# The Stanley Parable Launcher
#
# adapted by @mungler to use an embedded copy of the stanley parable game data
# adapted by @lachie to work with black mesa
# if this is not defined (default), the script will attempt to guess it
STEAMUSERID=""
# if your Steam application is somewhere other than /Applications, edit below.
@donatj
donatj / ColorCLI.php
Created October 26, 2011 03:34
Simple CLI color class
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',
@franz-josef-kaiser
franz-josef-kaiser / wp_config.php
Created March 7, 2011 21:48
Example from wp_config.php (wordpress config file) that shows different environments
/**
* Production, Staging, Live
*/
define( 'OXO_LOCAL_A', '/wordpress/' );
define( 'OXO_STAGE', 'some-stage.domain.com' );
if ( substr($_SERVER['REQUEST_URI'], 0, 11) == OXO_LOCAL_A )
{
// DB
define( 'DB_NAME', 'wordpress' );
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh