Skip to content

Instantly share code, notes, and snippets.

View niallobrien's full-sized avatar

Niall O'Brien niallobrien

  • Waterford, Ireland
View GitHub Profile
@niallobrien
niallobrien / fonts.scss
Created March 18, 2014 11:43
Foundation 5 - input field with inline search icon on the right.
// fonts from IcoMoon.io
// ..
// ..
// ..
.icon-search:before {
content: "\e600";
}
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
gutil = require('gulp-util'),
notify = require('gulp-notify'),
browserSync = require('browser-sync');
gulp.task('sass', function () {
gulp.src('scss/app.scss')
.pipe(plumber())
gulp.task('watch', ['browser-sync', 'serve'], function () {
var browserSync = require('browser-sync');
// watch for changes
gulp.watch([
"app/*.html",
"app/styles/**/*.css",
"app/scripts/**/*.js",
"app/images/**/*"
]).on('change', function () {
'use strict';
// generated on 2014-04-23 using generator-gulp-bootstrap 0.0.1
var gulp = require('gulp');
var browserSync = require('browser-sync');
// load plugins
var $ = require('gulp-load-plugins')();
gulp.task('styles', function () {
'use strict';
// generated on 2014-04-26 using generator-gulp-bootstrap 0.0.1
var gulp = require('gulp');
var browserSync = require("browser-sync");
// load plugins
var $ = require('gulp-load-plugins')();
gulp.task('styles', function () {
<aside id="sidebar" data-magellan-expedition="fixed" data-options="destination_threshold:190;threshold:200;throttle_delay:50;">
<dl class="accordion" data-accordion>
<dd id="mobile-sub-menu-button">
<a href="">Select page to visit</a>
</dd>
<dd class="show-for-medium-up">
<a href="#panel1">Heading 1</a>
<div id="panel1" class="content">
<ul>
<li>
.factory('StaffList', function ($http) {
var staffList = [];
return {
all: function () {
// returns promise object
return staffList = $http.get('API_URL', {
cache: true
});
},
@niallobrien
niallobrien / javascript_resources.md
Created August 7, 2014 20:20 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@niallobrien
niallobrien / rails_resources.md
Created August 7, 2014 20:20 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@niallobrien
niallobrien / app.js
Created August 21, 2014 09:24
Execute JS based on the current screen-size (Foundation's media queries)
var mediaStateContainer = document.querySelector('.mq'),
mediaState = window.getComputedStyle(mediaStateContainer, ':before').getPropertyValue('content');
if (mediaState === 'small' ) {
// JS to run when we're on mobile.
}