Skip to content

Instantly share code, notes, and snippets.

View wholypantalones's full-sized avatar

Jason Dare wholypantalones

View GitHub Profile
[
[
{
"a": 0
},
"Esc\n\n\n\n~\n`",
{
"a": 4
},
"!\n1\n\n\nF1",
@wholypantalones
wholypantalones / httpCache.js
Created July 20, 2016 16:57
Angular http cache config
.config(['$httpProvider', function($httpProvider) {
//initialize get if not there
if (!$httpProvider.defaults.headers.get) {
$httpProvider.defaults.headers.get = {};
}
//disable IE ajax request caching
$httpProvider.defaults.headers.get['If-Modified-Since'] = 'Mon, 26 Jul 1997 05:00:00 GMT';
// extra
$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache';
@wholypantalones
wholypantalones / pushbullet_steps.bin
Created July 9, 2016 15:43
Set up pushbullet boot notifications for a raspberry pi
# Multiple sources here:
# https://atinkerersblog.wordpress.com/2014/07/26/get-notified-when-your-raspberry-pi-is-booted-with-pushbullet/
# - follow the steps to make rc.local executable below
# this script is a compilation of all three below
# https://learnraspi.com/get-notifications-raspberry-pi-pushbullet/
# http://biosrhythm.com/?p=1151
# http://askubuntu.com/questions/9853/how-can-i-make-rc-local-run-on-startup
# create the pushbullet script
$ sudo nano /usr/bin/notify.sh
@wholypantalones
wholypantalones / controller.js
Last active June 24, 2016 15:13
Angular table sorting
$scope.reverseSort ='ASC'; // Default sort reverse true / false
$scope.sortData = {
sortColumn:'column',
sortDirection:$scope.reverseSort
}; // default values sent to service
$scope.sortAction = function(column,page) {
$scope.reverseSort = $scope.reverseSort === 'DESC'?'ASC':'DESC';
$scope.sortData.sortDirection = $scope.reverseSort;
$scope.sortData.sortColumn = column;
@wholypantalones
wholypantalones / Material Monokai Soda.sublime-theme
Created June 13, 2016 20:25
Material Monokai Soda theme sidebar spacing
[
{
"class": "sidebar_tree",
"indent": 0, // original value is 16
"row_padding": [0, 3],
"indent": 8,
"indent_offset": 5,
"indent_top_level": true,
}
]
@wholypantalones
wholypantalones / view-scope.js
Created June 13, 2016 19:08
How can she scope?
angular.element('[ng-controller=MainCtrl]').scope()
@wholypantalones
wholypantalones / Soda Dark.sublime-theme
Created May 31, 2016 12:35
ST3 sidebar padding and folder / arrow padding fix
[
{
"class": "icon_file_type",
"content_margin": [0,0]
},
{
"class": "icon_folder",
"content_margin": [0,0]
},
{
@wholypantalones
wholypantalones / onemit.js
Last active September 2, 2016 18:44
Angular $on & $emit args because I suck at remembering the event,arg thing..
$rootScope.$emit('getChildren',arg1,arg2);
$rootScope.$on('getChildren', function(event,arg1,arg2) {
$scope.getChildren(arg1,arg2);
});
@wholypantalones
wholypantalones / Gruntfile.js
Last active April 1, 2016 19:26
Common Grunt / Bower fixes
/*
Pretty much any time something is missing after building and doing a grunt serve:dist, it is because the grunt ecosystem is rewriting the page to look for your resources in a location that it failed to copy your resources to. Usually you can grunt serve:dist, open dev tools, and look at the network tab to see which url's are broken (red) and then make note of the path where the browser is trying to find the resource. Now you just need to create a new grunt copy task to copy the files to that path, and then add a reference to execute the copy in the grunt build (or just add to the existing copy:dist task as in the example below).
*/
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
@wholypantalones
wholypantalones / moment.js
Created March 23, 2016 12:52
Moment local
var makeLocal = moment().local(),
newtime = moment(makeLocal).format().toString();