Skip to content

Instantly share code, notes, and snippets.

ando dre1080

Block or report user

Report or block dre1080

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Couto
Couto / webpack.js
Last active Jul 9, 2019
Fetch polyfill with webpack
View webpack.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@malarkey
malarkey / Contract Killer 3.md
Last active Oct 22, 2019
The latest version of my ‘killer contract’ for web designers and developers
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@addyosmani
addyosmani / pubsub.md
Created Oct 28, 2011
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)
View pubsub.md

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@dhrrgn
dhrrgn / csrf.php
Created Oct 23, 2011
Simple, yet effective CSRF class for FuelPHP.
View csrf.php
<?php
/**
* Simple, yet effective CSRF class for FuelPHP.
*
* @author Dan Horrigan
* @license MIT License
* @copyright 2011 Dan Horrigan
*/
/**
@wbailey
wbailey / databases.rake
Created Feb 11, 2011
ActiveRecord migrations outside of Rails
View databases.rake
require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)
@octplane
octplane / mongo_pubsub.rb
Created Nov 9, 2010
Simple Pub/Sub system using MongoDB, capped collections and tailable cursors in ruby
View mongo_pubsub.rb
require 'rubygems'
require 'mongo'
module MongoPubSub
QUEUES_COLLECTION = 'queues'
class EndSubscriptionException < Exception; end
class Publisher
def initialize(queue_name, mongo_connection)
# Initialize queue collection as a capped collection
if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name)
You can’t perform that action at this time.