Skip to content

Instantly share code, notes, and snippets.

View natenolting's full-sized avatar
🤘
Fixing stuff...

Nate Nolting natenolting

🤘
Fixing stuff...
View GitHub Profile
@emyarod
emyarod / color-map.scss
Created April 8, 2016 09:35
Google Material Design colors in a Sass map
// $primary: get-color('cyan', '500');
@function get-color($color-hue, $color-shade: '500') {
$color: map-get(map-get($colors, $color-hue), $color-shade);
@if $color {
@return $color;
} @else { @error '=> ERROR'; }
}
$colors: (
@ravanscafi
ravanscafi / _readme.md
Last active June 22, 2019 14:42
Proper way to use LiveReload with Laravel Elixir

Proper way to use LiveReload with Laravel Elixir

Features

  • It works without touching laravel-elixir source files, so it will not break on updates.
  • It runs only on watch task, so that when you run other tasks, livereload will not start and hang the console.
  • It performs soft-reloads on CSS changes, instead of a full page reload.

Instructions

  1. npm install gulp-livereload if you still don't have it.
  2. Create an elixir.json file on the root of your project (where your gulpfile.js is located)
@aindong
aindong / DynamicSetterGetter.php
Created April 16, 2015 15:47
Dynamic setter/getter using __call magic method of php
<?php
class Person
{
protected $firstName;
protected $lastName;
/**
* Magic method call for setter and getter
*
* @param $methodName
@hirobert
hirobert / OAuth.php
Last active February 6, 2023 07:35
Noun Project API - PHP Example
<?php
// mirror of: http://oauth.googlecode.com/svn/code/php/OAuth.php
// vim: foldmethod=marker
/* Generic exception class
*/
class OAuthException extends Exception {
// pass
}
@willprice
willprice / .travis.yml
Last active August 15, 2023 17:12
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@demisx
demisx / gulpfile.js
Last active November 6, 2019 23:10
My Gulp file example
var gulp = require('gulp'),
debug = require('gulp-debug'),
size = require('gulp-filesize'),
clean = require('gulp-clean'),
coffee = require('gulp-coffee'),
coffeelint = require('gulp-coffeelint'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
imagemin = require('gulp-imagemin'),
changed = require('gulp-changed'),
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@frane
frane / ArrayObjectDemo.coffee
Created December 31, 2011 02:19
Traversing arrays and objects in CoffeeScript
# Traversing arrays and objects in CoffeeScript
# The array and object we use for testing
arr = [1, 2, 3, 4, 5]
obj = {a: 1, b: 2, c: 3, d: 4, e: 5}
# 'in' has a different meaning in CoffeeScript than in JavaScript
# CS: element in array -> JS: array.indexOf(element) >= 0
console.log '5 in arr: ' + (5 in arr)