Skip to content

Instantly share code, notes, and snippets.

wget -qO- http://ipecho.net/plain ; echo
curl ipecho.net/plain ; echo
@jbonney
jbonney / link.txt
Created January 31, 2014 22:42
Ruby Styleguide from GitHub
CREATE USER 'dbbackup'@'localhost' IDENTIFIED BY '***';
GRANT SELECT ,
RELOAD ,
FILE ,
SUPER ,
LOCK TABLES ,
SHOW VIEW ON * . * TO 'dbbackup'@'localhost' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
# Get info about current kernel
uname -a
# List installed kernels
dpkg-query -l | awk '/linux-image-*/ {print $2}'
# Remove old kernel and dependencies (DO NOT DELETE KERNEL FROM uname -a)
sudo apt-get --purge remove <Kernel>
sudo apt-get autoremove
# Update grub (usually not necessary)
sudo update-grub
@jbonney
jbonney / crontab
Last active August 29, 2015 14:22
Script to check the internet connection of a kiosk and reload the active page in case the connection drops and then comes back online. Sources: -http://alexba.in/blog/2015/01/14/automatically-reconnecting-wifi-on-a-raspberrypi/ - http://raspberrypi.stackexchange.com/questions/6981/auto-refresh-for-midori - http://www.lynsayshepherd.com/blog/2014…
*/2 * * * * DISPLAY=:0 sh /usr/local/bin/wifi_reloader.sh
@jbonney
jbonney / Preferences.sublime-settings
Last active October 12, 2015 05:38
Sublime 2 - Preferences User Settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/Base16 Color Schemes/base16-default.dark.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
@jbonney
jbonney / .gitconfig
Created November 12, 2012 17:36
Git configuration file
[user]
name = Your Name
email = ...@email.com
[alias]
ls = ls-files
co = checkout
ci = commit
br = branch
df = diff
dc = diff --cached
@jbonney
jbonney / concerns.rb
Created May 8, 2013 10:47 — forked from dhh/gist:1014971
ActiveSupport::Concern sample template. Additional documentation available on Rails page: http://api.rubyonrails.org/classes/ActiveSupport/Concern.html
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@jbonney
jbonney / Gemfile
Created May 9, 2013 11:47
Combine Parsley.js and Twitter Bootstrap
source 'https://rubygems.org'
gem "twitter-bootstrap-rails", ">= 2.2.6", :group => :assets
gem "parsley-rails", "~> 1.1.16.0", :group => :assets
@jbonney
jbonney / I18n.sublime-snippet
Created May 23, 2013 10:16
Code snippet for sublime text: I18n in Rails
<snippet>
<content><![CDATA[
I18n.t('${1:dictionary.key}')
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>18</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.ruby, source.html, source.js</scope>
</snippet>