Skip to content

Instantly share code, notes, and snippets.

View electblake's full-sized avatar
🧙

Blake E electblake

🧙
View GitHub Profile
cat ~/.ssh/id_rsa.pub | ssh user@server.com 'cat >> .ssh/authorized_keys'
@electblake
electblake / fix_permission.sh
Created January 20, 2013 07:13
Set Correct Permissions for public_html in Apache (Run when cd'd into public_html)
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;
@electblake
electblake / lighttpd.conf
Last active March 13, 2019 13:05
lighttpd.conf - Laravel 4 (php5 + homebrew)
# lighttpd -D -f conf/lighttpd.conf
server.document-root = "/path/to/webroot"
server.port = 8080
#server.username = "username"
#server.groupname = "password"
static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" )
index-file.names = ( "index.html", "index.php", "server.php" )
@electblake
electblake / nginx.conf.erb
Created October 29, 2013 22:46
Laravel 4 nginx Config for use in /conf of your heroku app. Read More at: https://github.com/iphoting/heroku-buildpack-php-tyler
## Customized for Laravel 4
# setting worker_processes to CPU core count
worker_processes 1;
daemon off;
events {
worker_connections 1024;
}
@electblake
electblake / demonoid.stylebot.css
Created August 12, 2014 18:00
demonoid stylebot
#rh-bnr-wrp_DMD160X600RS {
display: none;
}
#rhfrm_AS1DEMONOID_14535_7 {
display: none;
}
td.pad9px_right {
display: none;
@electblake
electblake / piratebay.stylebot.css
Created August 12, 2014 18:01
piratebay.stylebot.css
#content {
margin: 0;
max-width: 100%;
padding: 0;
width: 100%;
}
#detailsouterframe {
margin: 0;
width: 100%;
@electblake
electblake / scaffold.angular.config.postaljs-$bus.js
Last active November 5, 2019 09:14
simple config to expose postal.js under $scope.$bus
'use strict';
angular.module('myApp') // use whatever your app is using to load configs
.config(['$provide', function ($provide) {
$provide.decorator('$rootScope', [
'$delegate', function ($delegate) {
Object.defineProperty($delegate.constructor.prototype,
'$bus', {
value: postal, // probably could wrap into window.postal but this works fine for me
enumerable: false
});
@electblake
electblake / pre-commit.sh
Last active August 29, 2015 14:07
automatically generate RELEASE version and revision
#!/bin/bash
## Automatically generate RELEASE version and revision
##
## Example:
## Given a most recent tag of `0.0.1` in git, this hook maintains a file like `RELEASE` of contents `0.0.1.rev-94`
## Install:
## mv pre-commit.sh .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
exec 1>&2
revisioncount=`git log --oneline | wc -l`
@electblake
electblake / timeFormat.js
Created November 2, 2014 17:00
timeFormat filter to accept seconds and format 00:00:00
'use strict';
/**
* @ngdoc filter
* @name musiLandingApp.filter:timeFormat
* @function
* @description
* # timeFormat
* Filter in the musiLandingApp.
*/
@electblake
electblake / config.js
Last active August 29, 2015 14:09
12factor Combined .env Sample - /app/lib/config.js
var config = require('12factor-config'),
path = require('path'),
fs = require('fs');
// load .env file from relative ../.env
var envFile = path.join(__dirname, '../', '.env');
if (fs.existsSync(envFile)) {
var env = require('node-env-file');
env(envFile, { overwrite: true});
}