View .emacs_latest
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
)
(custom-set-variables
;; custom-set-variables was added by Custom.
View .emacs_new
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
)
(custom-set-variables
;; custom-set-variables was added by Custom.
View Sublime settings
{
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"detect_indentation": false,
"folder_exclude_patterns":
[
".bundle",
".git",
".sass-cache",
"coverage",
"tmp"
View .emacs
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
)
(custom-set-variables
;; custom-set-variables was added by Custom.
View logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# use the syslog group by default, since this is the owning group
# of /var/log/syslog.
su root syslog
# keep 4 weeks worth of backlogs
rotate 4
View jquery.loadmask.js
;(function($){
$.fn.mask = function(label, delay){
$(this).each(function() {
if(delay !== undefined && delay > 0) {
var element = $(this);
element.data("_mask_timeout", setTimeout(function() { $.maskElement(element, label)}, delay));
} else {
$.maskElement($(this), label);
}
View railscasts.rb
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'
View bowling_match_score_calculator
def bowling(input)
scores = []
result = []
scores = input.split.collect { |e| e.to_i }
cf = 0 # current frame
i = 0
while(cf < 10) do
if scores[i] == 10 # For strike
result[cf] = scores[i] + scores[i + 1] + (scores[i + 2] ? scores[i + 2] : 0)
View _flash_messages.html.erb
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
View decimal_to_binary.rb
def dec2bin(number)
number = Integer(number)
if(number == 0) then 0 end
ret_bin = ""
while(number != 0)
ret_bin = String(number % 2) + ret_bin
number = number / 2
end
ret_bin