This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To see available batteries run "upower -e" | |
BATTERY_PERCENTAGE=`upower -i /org/freedesktop/UPower/devices/DisplayDevice |grep percentage |awk -F: '{ print $2}' |awk -F% '{gsub(/ /, ""); print $1 }' |awk -F, '{ print $1 }'` | |
if [ $((BATTERY_PERCENTAGE)) -lt 10 ]; then | |
notify-send -u critical -c device -i /usr/share/icons/gnome/48x48/status/battery-low.png "Battery Level Low!" "%$BATTERY_PERCENTAGE" | |
fi | |
# Crontab entry: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plugin 'gmarik/Vundle.vim' | |
Bundle 'L9' | |
Plugin 'tpope/vim-dispatch' | |
Plugin 'tpope/vim-commentary' | |
Plugin 'tpope/vim-bundler' | |
Plugin 'tpope/vim-rails' | |
Plugin 'vim-ruby/vim-ruby' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
" Ruby snippets | |
" Last change: August 6 2007 | |
" Version> 0.1.0 | |
" Maintainer: Eustáquio 'TaQ' Rangel | |
" License: GPL | |
" Thanks to: Andy Wokula and Antonio Terceiro for help and patches. | |
" | |
if exists("b:rubysnippets_ignore") | |
finish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" An example for a vimrc file. | |
" | |
" Maintainer: Bram Moolenaar <[email protected]> | |
" Last change: 2002 May 28 | |
" | |
" To use it, copy it to | |
" for Unix and OS/2: ~/.vimrc | |
" for Amiga: s:.vimrc | |
" for MS-DOS and Win32: $VIM\_vimrc | |
" for OpenVMS: sys$login:.vimrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $ | |
# | |
# vim-keys.conf, v1.2 2010/09/12 | |
# | |
# By Daniel Thau. Public domain. | |
# | |
# This configuration file binds many vi- and vim-like bindings to the | |
# appropriate tmux key bindings. Note that for many key bindings there is no | |
# tmux analogue. This is intended for tmux 1.3, which handles pane selection | |
# differently from the previous versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConvertTextToMediumInPostAndPageTranslations < ActiveRecord::Migration | |
def up | |
change_column :post_translations, :text, :text, :limit => 64.kilobytes + 1 | |
change_column :page_translations, :text, :text, :limit => 64.kilobytes + 1 | |
end | |
def down | |
change_column :post_translations, :text, :text | |
change_column :page_translations, :text, :text | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: app/models/concerns/boolean_store_accessor.rb | |
# | |
# When we submit a form in order to update a model, a booelan/checkbox field is posted | |
# as '1' or '0', and if we are using ActiveRecord::Store, posted value is stored in | |
# database as '1' or '0'. By the help of this module, we store '1' and '0' | |
# values as `true` or `false`. | |
# | |
# Example usage: | |
# | |
# ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin::AppsController < Admin::BaseController | |
before_filter :load_app | |
def index | |
@apps = App.all | |
end | |
def show | |
load_app | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE_TO_DOWNLOAD=`ssh [email protected] 'ls -Art /tmp/dir |tail -n 1'` | |
scp [email protected]:/tmp/dir/${FILE_TO_DOWNLOAD} . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dashboard::Payments::CardsController < ::Dashboard::Payments::BaseController | |
self.responder = Core::CustomServiceResponder | |
respond_to :html | |
before_action :customer_required | |
def destroy | |
service = Payments::Stripe::DeleteCreditCard.new(current_user) | |
status_object = service.call(params[:identifier]) |
NewerOlder