Skip to content

Instantly share code, notes, and snippets.

View wgallios's full-sized avatar

William Gallios wgallios

View GitHub Profile
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@wgallios
wgallios / .bashrc
Last active August 29, 2015 14:03
custom .bashrc stuff
# changes "ls" functionality to include flags "ls -AlFh"
if [ "$TERM" != "dumb" ]; then
eval `dircolors -b`
export LS_OPTIONS='-AlFh --color=always'
alias ls='ls $LS_OPTIONS'
fi
alias lsd='ls -AlFh --color | grep ^drw'
alias lsnd='ls -AlFh --color | grep -v ^drw'
alias cleanvim='find . -name "*.swp" -type f -delete'
@wgallios
wgallios / ng-really.js
Last active August 29, 2015 14:06 — forked from asafge/ng-really.js
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
@wgallios
wgallios / auth.js
Created September 13, 2014 04:45
Node.js/total.js authorization module example
// MIT License
// Copyright Peter Širka <petersirka@gmail.com>
// Version 1.02
var events = require('events');
var SUGAR = 'AtH101s84';
var USERAGENT = 20;
// expireCookie in days
// expireSession in minutes
@wgallios
wgallios / alertsManager.js
Last active August 29, 2015 14:06
Angular.js service to manage alerts - used primarily with ui.bootstrap
/**
* Author: William Gallios <williamgallios@gmail.com>
*
* License: MIT
*
* @param msg - Alert Message
* @param type (optional) - warning|success|danger|info
* @param header (optional) - header of alert
*
* Usage: alertsManager.addAlert('You're doing a great yob!', 'success', 'Wow!');
@wgallios
wgallios / selectOnClick
Created September 15, 2014 06:24
AngularJS Directive to select all on-click for an input
app.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.on('click', function () {
this.select();
});
}
};
});
@wgallios
wgallios / grub.conf
Last active August 29, 2015 14:08
grub.conf for grub legacy bootloader used to boot Ubuntu 14.10 64-bit on Acer Switch 10
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
color green/black white/gray
#hiddenmenu
title Ubuntu 14.10 x64
root (hd0,0)
kernel /casper/vmlinuz.efi ro root=/dev/sda1 file=/cdrom/preseed/ubuntu.seed boot=casper rhgb quiet splash --
initrd /casper/initrd.lz
#!/bin/bash
set -e
if [ ! -z "$1" ]; then
KERNEL="$1"
else
KERNEL="$(uname -r)"
fi
@wgallios
wgallios / .muttrc
Created November 11, 2014 06:42
Example Muttrc File
set imap_user = "username@gmail.com"
set imap_pass = ""
set smtp_url = "smtp://username@smtp.gmail.com:587"
set smtp_pass = ""
set from = "username@gmail.com"
set realname = "FirstName LastName"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
@wgallios
wgallios / GPL.md
Last active August 29, 2015 14:10 — forked from jnrbsn/GPL.md

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.