Skip to content

Instantly share code, notes, and snippets.

# This is a manifest file that'll be compiled into application.js, which will include all the files
# listed below.
#
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
#
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
# the compiled file.
#
# WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
### Keybase proof
I hereby claim:
* I am chrissearle on github.
* I am chrissearle (https://keybase.io/chrissearle) on keybase.
* I have a public key whose fingerprint is 116F BA82 9506 5A01 C3BC 7CC6 CF79 BF54 D4BF 0A41
To claim this, I am signing this object:
@chrissearle
chrissearle / asyncFactory.js
Created September 24, 2014 19:10
AngularJS - service to call http async and return data to controller - is there a better way than exposing the promise itself back to the controller?
.factory('someService', ['$http', function ($http) {
return {
async: function () {
return $http.get('someUrl').then(function (response) {
return response.data;
});
}
};
}]).controller('someController', ['$scope', 'someService', function ($scope, someService) {
someService.async().then(function (d) {
@chrissearle
chrissearle / An Applog Issue
Created August 12, 2011 19:19
AppLog for NSLog
Taken from iOS recipes and renamed to something I find easier to type ;)
This all works fine. When -DAPPDEBUG=1 is not defined nothing gets logged.
When defined AppLog works like NSLog.
But - when defined - I get a "Semantic issue: Implicit declaration of function 'AppDebugLog' is invalid in C99" every place I use AppLog as an XCode warning.
Should I ignore? Have I imported the header in the wrong place?
@chrissearle
chrissearle / munin-node
Created March 19, 2012 10:03
Quick and dirty munin script for monitoring PMS FD/socket counts
/etc/munin/plugin-conf.d/munin-node
**snip**
[plex]
user root
tail -c `head -n 1 PlexMediaServer-0.9.6.3.139-9c9f5ce-i686.bin | sed -e "s/.*size=//" | sed -e "s/,.*//"` PlexMediaServer-0.9.6.3.139-9c9f5ce-i686.bin | tar zOx files.tgz | tar zt
./bin/
./bin/bzip2
./bin/bunzip2
./etc/
./etc/frontview/
./etc/frontview/apache/
./etc/frontview/apache/addons/
./etc/frontview/apache/addons/PLEXMEDIASERVER.conf
@chrissearle
chrissearle / test_pms_bin.sh
Created June 4, 2012 13:44
Show the plugins etc content of a Plex Media Server ReadyNAS .bin file
#!/bin/bash
BIN=$1
VER=${BIN#*-}
VER=${VER%-*}
PLUGINS=./tmp/rnxtmp/PlexMediaServer-${VER}.tar.bz2
tail -c `head -n 1 $BIN | sed -e "s/.*size=//" | sed -e "s/,.*//"` $BIN | tar zOx files.tgz | tar zOx $PLUGINS | bunzip2 | tar t
#!/usr/bin/env ruby
require 'cinch'
require 'i18n'
def beer?
weeknum = (I18n.l Time.now, :format => '%V').to_i
dow = (I18n.l Time.now, :format => '%u').to_i
dow == 2 && (weeknum % 2 == 1)
@chrissearle
chrissearle / gist:5809409
Created June 18, 2013 21:12
JZ app search predicate
Here we've got the following filters running.
session state must be approved // don't show non-approved sessions
AND
session conference must be the selected conference // example shows 2012
AND
free text search on kev // searches both title and speaker name
AND
level is set to beginner // can have several if we want - multiple levels are OR'd together
AND
* List item 1
* List item 2
code line 1
code line 2
code line 3
* List item 3