Skip to content

Instantly share code, notes, and snippets.

View rlvdx's full-sized avatar
driven by fun

Raphaël Louvradoux rlvdx

driven by fun
View GitHub Profile
@pksunkara
pksunkara / config
Last active June 21, 2024 08:46
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@mattfarina
mattfarina / custom.module
Created December 27, 2011 16:05
Protocol Relative URLs in Drupal 7
<?php
/**
* Implements hook_file_url_alter().
*
* Make all URLs be protocol relative.
* Note: protocol relatice URLs will cause IE7/8 to download stylesheets twice.
* @see http://www.stevesouders.com/blog/2010/02/10/5a-missing-schema-double-download/
*/
function custom_file_url_alter(&$url) {
@mailtruck
mailtruck / colormeter.js
Created April 18, 2012 07:09 — forked from krypton/colormeter.js
Calculate difference in percentage between 2 hex colors
function color_meter(cwith, ccolor) {
if (!cwith && !ccolor) return;
var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith;
var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor;
var _r = parseInt(_cwith.substring(0,2), 16);
var _g = parseInt(_cwith.substring(2,4), 16);
var _b = parseInt(_cwith.substring(4,6), 16);
@benhosmer
benhosmer / AWS-CloudFormation-Drupal-From-A-Makefile.template
Created April 24, 2012 16:41
An AWS CloudFormation Template to install Drush, Drush_Make, and Drupal from a Makefile
{
"Description" : "RadiantBlue Drupal 7 CloudFormation template from a make file V.0.0.1",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "String",
@JustAdam
JustAdam / drupal_taxonomy_content_type.php
Created August 2, 2012 09:49
Drupal 7 - Programmatically create a taxonomy and attach a field to it, then create a content type and attach that taxonomy to it.
<?php
// Machine name for our custom node
define('NODE_NAME', 'the_node_machine_name');
// Machine name for our custom taxonomy
define('TAXONOMY_NAME', 'the_taxonomy_machine_name');
function module_install() {
_create_taxonomy();
_create_content_type();
}
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@kethinov
kethinov / walksync.js
Created September 22, 2013 09:04
List all files in a directory in Node.js recursively in a synchronous fashion
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
@jeresig
jeresig / cookiebot.js
Last active October 5, 2023 12:20
Simple bot for CookieClicker: http://orteil.dashnet.org/cookieclicker/ How to use: Paste the following into the JavaScript console in your browser and run it. To start the bot type: "CookieClicker.start();" to stop it do: "CookieClicker.stop();" (or just reload the page).
CookieClicker = {
start: function() {
this.clickInterval = setInterval(function(){
// Click the large cookie as fast as possible!
document.getElementById("bigCookie").click();
}, 1);
this.goldInterval = setInterval(function(){
// Click the golden cookie
var shimmer = document.getElementsByClassName("shimmer")[0];
@dieseltravis
dieseltravis / cookiebot.js
Last active December 24, 2015 01:29 — forked from jeresig/cookiebot.js
cookie clicker bot, you're too much fun
CookieBot = {
click: function clicker() {
clearInterval(this.clickInterval);
this.clickInterval = setInterval(function clickIntervaller() {
// Click the large cook as fast as possible!
$("#bigCookie").click();
}, 1);
// limit this to 15 for hidden achievement?
//TODO: test for achievement or clicks >= 15 use above, otherwise use below
@ob-ivan
ob-ivan / cookiebot.js
Last active June 27, 2022 07:47 — forked from jeresig/cookiebot.js
A little bit intelligent Cookie Clicker bot.
CookieBot = {
// Inner-use enum constants //
INTERVAL_BAKE : 0,
INTERVAL_GOLDEN : 1,
INTERVAL_PRODUCT : 2,
INTERVAL_UPGRADE : 3,
INTERVAL_DRAGON : 4,
INTERVAL_SANTA : 5,