Skip to content

Instantly share code, notes, and snippets.

View bswinnerton's full-sized avatar

Brooks Swinnerton bswinnerton

View GitHub Profile
@bswinnerton
bswinnerton / gist:4170385
Created November 29, 2012 17:00
Backup & Restore of Windows File Permissions
SAVE:
icacls '\\bobst.lib\Data\Personal\Users\bs122\My Documents\*' /save \\bobst.lib\Data\Personal\Users\bs122\Desktop\permissions.txt /t /c
RESTORE:
icacls '\\bobst.lib\Data\Personal\Users\bs122\My Documents\' /restore \\bobst.lib\Data\Personal\Users\bs122\Desktop\permissions.txt
@bswinnerton
bswinnerton / gist:4170399
Created November 29, 2012 17:01
Output File Times in Windows
Get-ChildItem -recurse | Select-Object Mode, FullName, CreationTime, LastWriteTime, LastAccessTime > \\bobst.lib\Data\Personal\Users\bs122\Desktop\output.txt
@bswinnerton
bswinnerton / gist:4180072
Created December 1, 2012 01:39
Adding already created files to existing github repository
git init
git add -A
git commit -m "initial creation"
git remote add origin https://github.com/bswinnerton/[repository].git
git pull https://github.com/bswinnerton/[repository].git master
git push origin master
@bswinnerton
bswinnerton / gist:4180178
Created December 1, 2012 02:09
My .vimrc
" use syntax highlighting
syntax on
" make backspace do what it should
set backspace=eol,start,indent
" set tab = 4 spaces
set expandtab
set sw=4
set sts=4
@bswinnerton
bswinnerton / gist:4217816
Created December 5, 2012 17:43
HP Printer Hack
telnet <host> 9100
@PJL RDYMSG DISPLAY="h@cked"
@bswinnerton
bswinnerton / .screenrc
Last active October 13, 2015 23:38
My .screenrc
# Suppress startup message
startup_message off
# Fix vim veritcal sizing issues inside screen
altscreen on
# Make top window cd into folder
chdir /var/www/WEBROOT/
# Start screen on top
@bswinnerton
bswinnerton / gist:4277524
Created December 13, 2012 16:13
Expiration Date Color Picker
// Javascript to change color of expiration date.
// Usage: wrap dates in YYYY-MM-DD format with <span class="expiredDate"></span>
window.onload = function() {
var spans = document.getElementsByTagName('span');
var l = spans.length;
for (var i = 0; i < l; i++) {
var spanClass = spans[i].getAttribute("class");
if ( spanClass === "expiredDate" ) {
var definedDate = spans[i].innerHTML.split("-");
var expiredDate = new Date(definedDate[0], definedDate[1] - 1, definedDate[2]);
@bswinnerton
bswinnerton / gist:4324773
Created December 18, 2012 03:37
Reddit Image Scraper
require 'faraday'
require 'nokogiri'
url = "http://reddit.com/r/pics"
request = Faraday.get(url)
doc = Nokogiri::HTML.parse(request.body)
doc.css("img").map do |x|
puts "<img src=\"" + x.attributes["src"] + "\" width=\"" + x.attributes["width"].to_s + "\" height=\"" + x.attributes["height"].to_s + "\">"
end
@bswinnerton
bswinnerton / babblings_index.html
Last active December 10, 2015 16:48
twitter bootstrap babblings
<!DOCTYPE html>
<html>
<head>
<title>babblings test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.css" rel="stylesheet" media="screen">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
</head>
<body>
<div class="container">
@bswinnerton
bswinnerton / babblings_bootstrap.css
Created January 5, 2013 19:19
twitter bootstrap babblings
/*!
* Bootstrap v2.2.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/