This file contains hidden or 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
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); | |
config.title = "Thesis"; | |
config.useGL30 = true; | |
config.height = 1280; | |
config.width = 768; | |
new LwjglApplication(new MyGdxGame(), config); |
This file contains hidden or 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
// If you are faced with a stupid library swallowing callback exceptions this | |
// function will still report the exception details to you. | |
function exposeException(fn) { | |
return function () { | |
try { | |
return fn.apply(this, arguments); | |
} catch (e) { | |
console.log("Exception occured", e); | |
throw e; |
This file contains hidden or 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
set-option -g default-shell /usr/local/bin/zsh | |
set -g prefix C-a | |
bind-key C-a last-window | |
bind-key v split-window -v | |
setw -g monitor-activity on | |
set-window-option -g window-status-current-bg white | |
setw -g mode-keys vi | |
set -g mode-mouse on | |
set-window-option -g utf8 on |
This file contains hidden or 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
daniel@tigraine in ~ | |
o tomdoc -v | |
TomDoc v0.2.5 | |
daniel@tigraine in ~ | |
o gem unpack tomdoc | |
Unpacked gem: '/home/daniel/tomdoc-0.2.5' | |
daniel@tigraine in ~ | |
o tomdoc tomdoc-0.2.5/lib/tomdoc/source_parser.rb | |
-------------------------------------------------------------------------------- | |
TomDoc::SourceParser.parse(text) |
This file contains hidden or 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 Festival < ActiveRecord::Base | |
attr_accessible :name, :client_id | |
belongs_to :client | |
has_many :covers | |
has_many :photos | |
def self.with_covers | |
where("covers_count > 0") # or some other SQL with a COUNT and group maybe that filters correctly |
This file contains hidden or 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
sudo ntpdate ntp.ubuntu.com | |
sudo apt-get install ntp |
This file contains hidden or 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
# Basic tagging system for mongoid documents. | |
# jpemberthy 2010 | |
# | |
# class User | |
# include Mongoid::Document | |
# include Mongoid::Document::Taggable | |
# end | |
# | |
# @user = User.new(:name => "Bobby") | |
# @user.tag_list = "awesome, slick, hefty" |
This file contains hidden or 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
MyApp::Application.config.secret_token = '10dfec4781b682762a731a5e88af78521fc3e0f8f216fe7d4171d8222be3d4f469a175af41549660db6ac144dba807eb70779aff46f428d6d92e9e2fa6fa96b3' |
This file contains hidden or 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
<div> | |
<%= render :partial => 'grid_list', :locals => { :list => @hot_videos, :dont_paginate => true } %> | |
</div> | |
<div> | |
<%= render :partial => 'grid_list', :locals => { :list => @videos } %> | |
</div> |
This file contains hidden or 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
@person = Person.first # a Person | |
link_to @person.name, @person # => /persons/1 | |
@student = Student.first # a Student | |
link_to @student.name, @student # => /students/2 | |
# this allows stuff like this: | |
@persons = Person.all # Person.all also includes Students | |
# @persons will look like this: [Person, Student, ..] | |
@persons.each do |p| | |
link_to p.name, p |
NewerOlder