Skip to content

Instantly share code, notes, and snippets.

View igbanam's full-sized avatar
🤿
vi/vim

Igbanam Ogbuluijah igbanam

🤿
vi/vim
View GitHub Profile
@igbanam
igbanam / git-status-alias
Created March 28, 2018 16:16
shortening git-status
[alias]
s = status
@igbanam
igbanam / nan.js
Last active October 25, 2017 15:34
Javascript Symptoms — NaN
NaN # This is a "thing"
NaN == NaN # => false
NaN === NaN # => false
@igbanam
igbanam / route_hooks.js
Created October 9, 2017 14:53 — forked from danielchappell/route_hooks.js
Ember.Route hook order
import Ember from 'ember';
// Ember 1.10
export default Ember.Route.extend({
//---fire in order on route enter---
beforeModel(transition) {
//empty by default
@igbanam
igbanam / rubyconf-ng-abstract-factory.rb
Last active August 13, 2017 10:21
RubyConf-NG Design Patterns
# The Abstract Factory
class Waiter
def initialize meal_order
@meal_order = meal_order
end
def serve!
@meal_order.utensil
@meal_order.delicacy
end
@igbanam
igbanam / frontendDevlopmentBookmarks.md
Created July 8, 2017 16:19 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@igbanam
igbanam / yii2-reverse-migration.php
Created March 8, 2017 23:20
To get the current state of a database into a migration for Yii 2
<?php
namespace app\commands;
use yii;
class MigrationReverserController extends \yii\console\Controller
{
public function actionRun($schema = null)
{
@igbanam
igbanam / Layout.php
Created July 25, 2013 20:50
Simple Rails-like templating for CodeIgniter
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Layout
{
// The CodeIgniter instance
static var $ci;
// Name of out layout file
var $layout;
@igbanam
igbanam / gist:2886165
Created June 7, 2012 02:27 — forked from gavinhughes/gist:1323987
Cucumber web steps
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'uri'
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
@igbanam
igbanam / behaviors.js
Created September 30, 2011 10:40 — forked from jamis/behaviors.js
Behavior-registration for UJS
// An Unobtrusive Javascript (UJS) driver based on explicit behavior definitions. Just
// put a "data-behaviors" attribute on your view elements, and then assign callbacks
// for those named behaviors via Behaviors.add.
var Behaviors = {
add: function(trigger, behavior, handler) {
document.observe(trigger, function(event) {
var element = event.findElement("*[data-behaviors~=" + behavior + "]");
if (element) handler(element, event);
});
@igbanam
igbanam / rails31_compass.rb
Created September 23, 2011 09:32
Integrate Compass with Rails 3.1 in steps
# These are the steps I took to integrate Compass with Rails 3.1 and the asset pipeline.
# 1. Add Compass to your Gemfile under the assets group
# Gemfile
group :assets do
gem 'compass'
# alongside other gems needed
end
# 2. Configure the load path for SASS