Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Birk cmbirk

View GitHub Profile
@cmbirk
cmbirk / jekyll-generator.sh
Created Apr 20, 2016
Creating new jekyll site with detached gh-pages branch
View jekyll-generator.sh
#!/bin/bash
##
# Based on the blog post at http://www.aymerick.com/2014/07/22/jekyll-github-pages-bower-bootstrap.html
##
echo "Please enter the github repository url ( git@github.com:<user>/<repo>.git ): "
read GIT_REPO
BASENAME=$(basename $GIT_REPO)
@cmbirk
cmbirk / style.txt
Created Jan 26, 2016
Testing Styling for ep_better_pdf_export
View style.txt
body {
color:blue;
}
View Contract Killer 3.md

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@cmbirk
cmbirk / gist:f3c528a7707beccbaa76
Created Apr 8, 2015
Laravel display all queries
View gist:f3c528a7707beccbaa76
//Thanks to http://laravel-tricks.com/tricks/display-all-sql-executed-in-eloquent
//Put this in your routes.php file
// Display all SQL executed in Eloquent
Event::listen('illuminate.query', function($query)
{
var_dump($query);
});
View keybase.md

Keybase proof

I hereby claim:

  • I am cmbirk on github.
  • I am cmbirk (https://keybase.io/cmbirk) on keybase.
  • I have a public key ASDxvDda42TMGq5vR47A0_1Ydq36iLJvnGojuiyFloPwcAo

To claim this, I am signing this object:

@cmbirk
cmbirk / gist:dc352ac20d3869cc8b71
Created Jan 13, 2015
Angular ui-router Loading Indicator
View gist:dc352ac20d3869cc8b71
A fairly simple and generic solution would be determining currently resolved ui-view by element hierarchy.
Create a directive and assign it to your ui-view elements. Example:
<div ui-view state-loader>
<div ui-view state-loader></div>
</div>
The directive will use the $stateChangeStart events to decide whether current ui-view is the one being resolved and add relevant classes. Example:
angular.module('myApp')
.directive('stateLoader', function stateLoader() {
return {
@cmbirk
cmbirk / gist:a34b7020c3a15ada7ff0
Created Jan 13, 2015
Angular ui-router Loading Indicator
View gist:a34b7020c3a15ada7ff0
A fairly simple and generic solution would be determining currently resolved ui-view by element hierarchy.
Create a directive and assign it to your ui-view elements. Example:
<div ui-view state-loader>
<div ui-view state-loader></div>
</div>
The directive will use the $stateChangeStart events to decide whether current ui-view is the one being resolved and add relevant classes. Example:
angular.module('myApp')
.directive('stateLoader', function stateLoader() {
return {
View simpleXML_to_object.php
<?php
/*
* Translate a non-standard object into an associative array object.
* Super-useful for dealing with simplexml objects.
*/
function simpleXML_to_object($obj)
{
$data = new StdClass();
if(
(is_object($obj) && get_class($obj) == 'SimpleXMLElement')
@cmbirk
cmbirk / gist:e5b39ea77aee1e1c49aa
Created Jul 10, 2014
Trying to combine multiple ManyToMany Relationships
View gist:e5b39ea77aee1e1c49aa
public function sponsor()
{
$sponsor = $this->belongsToMany('Group')->first();
if(!$sponsor) {
return $this->belongsToMany('User');
}
return $this->belongsToMany('Group');
View friday.js
function friday(e) {
if(e) {
// Not doin' nothin', it's Friday.
e.preventDefault();
}
/************$~I**************************Z*********************************
***********O,7.++O$+********************O,..ZI******************************
***********$..$.78.$******************$...7+. ~Z*******************+********
***********.Z.~.7D.O****************O,...,+. ....+Z*************7O+77I*+****