Skip to content

Instantly share code, notes, and snippets.

View joshuaadrian's full-sized avatar

Joshua Adrian joshuaadrian

View GitHub Profile
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
@joshuaadrian
joshuaadrian / Terminal Octal Permissions
Created August 18, 2014 15:20
Octal permissions view of file/directory
stat -f %A
clone down the Rails Vagrant Box https://github.com/railsmn/railsmn-dev-box and follow instructions.
alter rails version to desired in gemfile.
add gem "slim-rails" to gemfile and then bundle install.
# change to postgres user and open psql prompt
sudo -u postgres psql postgres
# list databases
postgres=# \l
# list roles
postgres=# \du
# create role
@joshuaadrian
joshuaadrian / GIT Global Config
Created October 11, 2014 13:47
In terminal access this file with - vim ~/.gitconfig
[user]
name = Your Name
email = [email protected]
[alias]
co = checkout
ci = commit -am
br = checkout -b
s = status -s
r = remote -v
lg = log --oneline --decorate --all --graph
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];
var length = methods.length;
@joshuaadrian
joshuaadrian / Scroller JS Class
Last active August 29, 2015 14:09
JS function to track user scrolling
(function() {
var Scroller = {
init: function() {
this.scrollWindow = $(window);
this.scrollDocument = $(document);
this.scrollElements = $('body > div');
this.windowHeight = this.scrollWindow.height();
@joshuaadrian
joshuaadrian / Gulp File
Created November 19, 2014 19:16
My Gulp file
var
gulp = require('gulp'),
gutil = require('gulp-util'), // Errors with load plugins... Need to fix
pngquant = require('imagemin-pngquant'), // Errors with load plugins... Need to fix
gulpLoadPlugins = require('gulp-load-plugins'),
plugins = gulpLoadPlugins({camelize: true})
;
gulp.task('default', ['watch', 'css', 'js', 'images']);
{
"private": true,
"devDependencies": {
"del": "^0.1.3",
"gulp": "^3.8.10",
"gulp-autoprefixer": "^2.0.0",
"gulp-concat": "^2.4.1",
"gulp-imagemin": "^2.0.0",
"gulp-livereload": "^2.1.1",
"gulp-load-plugins": "^0.7.1",
*~
.svn
.cvs
.git
.listing
*.bak
*.swp
*.log
*.sass-cache
plugins/wp-file-cache/cache