Skip to content

Instantly share code, notes, and snippets.

View hotmeteor's full-sized avatar
👾

Adam Campbell hotmeteor

👾
View GitHub Profile
@mpalourdio
mpalourdio / php-cs-fixer
Created November 12, 2014 21:24
@fabpot php-cs-fixer config for PhpStorm
parameters
--level=psr2 --verbose fix $FileDir$/$FileName$
working directory
$ProjectFileDir$
@trusktr
trusktr / DefaultKeyBinding.dict
Last active May 10, 2025 19:29
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@niallobrien
niallobrien / README.md
Last active May 2, 2016 11:57
Laravel & Angular Asset Pipeline with Gulp

Laravel & Angular

Overview

This setup involves creating a Laravel API and an Angular client-app with Gulp covering the asset pipeline.

Our Laravel API server will serve one view only and that is to simply load the Angular app.

First, create a new directory for your project. We're going to place the server and client directories in here. You'll need to install Laravel, Yeoman, generator-gulp-angular and any other dependencies.

Server

@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@lukaswhite
lukaswhite / ClearBeanstalkdQueueCommand.php
Last active February 6, 2025 13:11
Clear a Beanstalkd Queue in Laravel
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ClearBeanstalkdQueueCommand extends Command {
/**
@lrvick
lrvick / angular-socket.js
Created October 18, 2013 15:53
AngularJS service to connect to a websocket server (SockJS or pure WebSocket), manage reconnection, and allow the rest of the angular application to easily send/retrieve data from an open socket.
//TODO: make this a module
/**
* # SockJS socket management service
*
* Creates SockJS socket connection to server, re-connects on disconnection,
* and exports hooks to map handlers for various data interactions.
*
*/
angular.module('app').factory
var foodApp = angular.module('foodApp', ['ngResource']);
foodApp.factory('Food', ['$resource', function($resource){
return $resource('/food/:id', {id:'@id'}, { update: {method:'PUT' } } );
}]);
foodApp.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/food', {templateUrl: '/templates/list.html', controller: FoodController})
.when('/food/edit/:id', {templateUrl: '/templates/edit.html', controller: FoodController})
@Skoua
Skoua / gist:5927652
Last active July 29, 2016 19:07
Add route to an Apple Map using Google Maps Directions API in Titanium (Alloy).
// setup geolocation purpose and accuracy
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.purpose = L('geo-purpose');
// setup map and poi's annotation
var latitude = 48.847684,
longitude = 2.35165;
var annotation = Titanium.Map.createAnnotation({
animate: true,
@brettz9
brettz9 / HTMLSelectElement.prototype.selectedOptions.js
Last active July 25, 2019 16:04
selectedOptions shim (multiple select) with IE8 support
/**
* Polyfill for "fixing" IE's lack of support (IE < 9) for applying slice
* on host objects like NamedNodeMap, NodeList, and HTMLCollection
* (technically, since host objects are implementation-dependent,
* IE doesn't need to work this way). Also works on strings,
* fixes IE to allow an explicit undefined for the 2nd argument
* (as in Firefox), and prevents errors when called on other
* DOM objects.
* @license MIT, GPL, do whatever you want
-* @see https://gist.github.com/brettz9/6093105
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 12, 2025 02:24
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'