Skip to content

Instantly share code, notes, and snippets.

View CWSpear's full-sized avatar

Cameron Spear CWSpear

View GitHub Profile
@CWSpear
CWSpear / awesome-layout.html
Last active August 29, 2015 14:17
Handling filtering, sorting and pagination without any controller logic
<!-- "items" is the items in the full list, "displayed" is the items it'll show after filtering, sorting and paging -->
<awesome-list items="users" displayed="displayedUsers">
<div class="pre-table-header">
<!-- input for search placed here -->
<awesome-search></awesome-search>
<button class="btn btn-primary" ui-sref=".user({ id: 'new' })">Add User</button>
</div>
<table class="table">
@CWSpear
CWSpear / ajaxify-html5.js
Created July 8, 2012 05:16 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/3069522
;(function($, window, document, undefined) {
// Prepare our Variables
var History = window.History;
// Check to see if History.js is enabled for our Browser
if (!History.enabled) {
return false;
}
@CWSpear
CWSpear / index.html
Created July 11, 2012 03:16
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Blob &middot; CodePen</title>
<!--
Copyright (c) 2012 Hakim El Hattab, http://codepen.io/hakimel
Permission is hereby granted, free of charge, to any person obtaining
@CWSpear
CWSpear / index.html
Created July 11, 2012 03:16
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Blob &middot; CodePen</title>
<!--
Copyright (c) 2012 Hakim El Hattab, http://codepen.io/hakimel
Permission is hereby granted, free of charge, to any person obtaining
@CWSpear
CWSpear / current-page-link-highlighter.js
Created August 22, 2012 20:43
Highlight all links pointing to the current page. This works a bit more effectively because it uses .prop() as opposed to .attr(), but requires jQuery 1.6 or greater.
@CWSpear
CWSpear / object_merge.php
Created September 18, 2012 19:11
object_merge for php
<?php
$one->one = 1;
$two->two->one = 21;
$two->two->two = 22;
$three->two->one = 31;
$return_obj = object_merge($one, $two, $three);
// returns:
// Array
@CWSpear
CWSpear / config.rb
Created October 10, 2012 00:52
concrete5: Compass + Sass: handle typography.css (moves typography.css up one directory when you compile stylesheets)
# after your other config stuff add:
require 'fileutils'
on_stylesheet_saved do |file|
if File.exists?(file) && File.basename(file) == "typography.css"
puts "Moving: #{file}" # optional line, just letting you know what's going
FileUtils.mv(file, File.dirname(file) + "/../" + File.basename(file))
end
end
@CWSpear
CWSpear / jshint.json
Created October 11, 2012 18:17
My JSHint Settings (used in CodeKit and Sublime Text 2 via SublimeLinter)
{
"bitwise": true,
"eqeqeq": true,
"latedef": true,
"newcap": true,
"noarg": true,
"nonew": true,
"regexp": true,
"trailing": true,
@CWSpear
CWSpear / index.html
Created October 22, 2012 05:53
A CodePen by douglasdeodato. Single Element Pure CSS MacBook Pro - This is just an experiment! There are certainly better ways to show an image of a MacBook, but none as fun as this :)
<i class="macbook"></i>
@CWSpear
CWSpear / keybase.md
Last active September 12, 2019 07:14

Keybase proof

I hereby claim:

  • I am cwspear on github.
  • I am cwspear (https://keybase.io/cwspear) on keybase.
  • I have a public key ASAwLIiSBAGa4R9WD7NthgxpTker-RrK96NKcFaQURNMUgo

To claim this, I am signing this object: