Skip to content

Instantly share code, notes, and snippets.

View OwenMelbz's full-sized avatar

Owen Melbourne OwenMelbz

View GitHub Profile
/**
* You may use this code for free on any web page provided that
* these comment lines and the following credit remain in the code.
* Cross Browser Fireworks from http://www.javascript-fx.com
*/
/*************************************************/
if(!window.JSFX) JSFX=new Object();
if(!JSFX.createLayer)
{/*** Include Library Code ***/
@OwenMelbz
OwenMelbz / Gruntfile.js
Created May 4, 2015 10:05
Owens Gruntfile
module.exports = function(grunt){
var _config = {
/* Browser Sync */
clicks : true,
forms : true,
scroll : true,
/* JS Settings */
@OwenMelbz
OwenMelbz / Google Map Directive
Created July 1, 2015 16:29
Responsive Google Maps Icon (UIKit & AngularJS)
App.directive('map', function(){
return {
restrict: 'A',
link: function($scope, element, attrs){
var pos = attrs.map ? eval('('+attrs.map+')') : {};
window.map_loaded = function(){
@OwenMelbz
OwenMelbz / scroll.js
Created July 16, 2015 14:46
Javascript Section Scrolling with Mousewheel (needs jquery, underscorejs)
var sections = $('[data-tag]:not(.navigation):not(.footer):not(.story-time)'),
activeSection = null,
getNextSection = function(){
var coords = [],
top = $(window).scrollTop();
_.each(sections, function(s){

Scroll Down to Sections

Allows you to scroll down to sections of multiple heights within your page - it will autoscroll down to the next section, if the area is larger than the screen it will let you continue scrolling normally until the next area is ready, it then lets you scroll back up naturally.

A Pen by Owen Melbourne on CodePen.

License.

@OwenMelbz
OwenMelbz / whenDefined.js
Created April 14, 2016 18:12
Helper function that fires when an object becomes avaiable
//Inspired by http://fokkezb.nl/2016/04/14/how-to-wait-for-a-javascript-variable-to-be-defined/
//var console = document.getElementById('console');
//console.innerText = 'not loaded';
var whenDefined = function($context, $variable, $callback){
if( $context[$variable] ){
$callback();
} else {
@OwenMelbz
OwenMelbz / snippets.cson
Created March 21, 2017 19:12
My snippets.cson
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@OwenMelbz
OwenMelbz / dev
Created June 18, 2017 09:46
DNSMasq Config
nameserver 127.0.0.1
@OwenMelbz
OwenMelbz / .bashrc
Created August 16, 2017 16:33
Handy bash aliases
alias code='cd ~/Sites'
alias nah='git reset --hard;git clean -df;'
gogo() {
git add .
git commit -m "$(echo $@)"
git pull
git push
}
@OwenMelbz
OwenMelbz / 1. Installation.md
Last active September 1, 2017 09:47
rmate alias setup for ssh

Installation

SSH into the server

Run the installer

source <(curl -fsSL https://gist.githubusercontent.com/OwenMelbz/b188d3fc7a68e54e542793f9395013f3/raw/85e060e99e407b34049fe72ca9719591bec0ec2a/setup.sh)