Skip to content

Instantly share code, notes, and snippets.



uname -a     # Display Linux System Information
uname -r     # Display kernel release information
uptime       # Show how long the system has been running + load
hostname     # Show system host name
hostname -i  # Display the IP address of the host
last reboot  # Show system reboot history
date         # Show the current date and time
kkiernan / vuejs-filter-snake-to-title.js
Last active Mar 10, 2020
A Vue.js filter that converts snake case to title case.
View vuejs-filter-snake-to-title.js
* Converts a snake case string to title case.
* Example: snake_case => Snake Case
* @param {String} str the string to convert
* @return {String}
Vue.filter('snakeToTitle', function (str) {
return str.split('_').map(function (item) {
return item.charAt(0).toUpperCase() + item.substring(1);
View get webpage thumbnails from Google
$sites = "";
$sites = preg_split('/\r\n|\r|\n/', $sites);
echo "
View cap recipe for media temple grid server
# After running cap deploy:cold, You'll need to remove all files from the
# domains/ directory and turn the html directory into a
# symlink that links to ./current which is also a symlink setup by capistrano.
# install the mt-capistrano gem, not sure if it is really needed in most situations
require 'mt-capistrano'
# Configure these
paulredmond / get-age.php
Created Sep 27, 2012
Get age with PHP's DateTime
View get-age.php
$birthday = '01/01/1970';
$age = DateTime::createFromFormat('m/d/Y', $birthday)
->diff(new DateTime('now'))
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

adamwdraper / gist:2951011
Last active Oct 6, 2015
AMD jQuery plugin template
View gist:2951011
// Uses AMD or browser globals to create a jQuery plugin.
* Name - jQuery Plugin
* Version: 0.0.1 (5/25/2012)
* Requires: jQuery v1.7+
* Copyright (c) 2011 User -
* Under MIT and GPL licenses:
View node-scroll-info.js
Copyright (c) 2012 Ryan Grove. All rights reserved.
Redistribution and use of this software in source and binary forms, with or
without modification, are permitted provided that the following conditions are
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
justinrainbow / watch.js
Created Mar 27, 2012
Auto building of YUI3 modules
View watch.js
var watch = require('watch'),
spawn = require('child_process').spawn,
queue = [],
function run(path) {
if (proc) {
return queue.push(path);
them0nk / rspec_rails_cheetsheet.rb
Created Mar 23, 2012
Rspec Rails cheatsheet (include capybara matchers)
View rspec_rails_cheetsheet.rb
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
response.should render_template(:index)
response.should redirect_to(movies_path)