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
CURRENT_PATH = File.expand_path(File.dirname(__FILE__)) | |
def my_system(*cmd) | |
pid = fork do | |
exec(*cmd) | |
exit! 127 | |
end | |
yield pid if block_given? | |
Process.waitpid(pid) | |
$? |
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
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
config.grid_fs_database = "database_name" | |
config.grid_fs_host = 'localhost' | |
config.grid_fs_access_url = "/uploads" | |
config.storage = :grid_fs | |
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
#!/bin/sh | |
# | |
# Update Textmate bundles | |
# Standard OS X Textmate bundle Verzeichnis | |
TEXTMATE_BUNDLES="$HOME/Library/Application Support/Textmate/Bundles" | |
# … ins Verzeichnis wechseln | |
echo "\n*** Wechsle ins Textmate bundle Verzeichnis..." |
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
# Code example for http://wojt.eu/post/13496746332/retrieving-gmail-thread-ids-with-ruby | |
def patch_net_imap_response_parser(klass = Net::IMAP::ResponseParser) | |
klass.class_eval do | |
def msg_att | |
match(T_LPAR) | |
attr = {} | |
while true | |
token = lookahead | |
case token.symbol |
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
# Basic Settings | |
# | |
# fontName = "Source Code Pro" | |
# fontSize = 13 | |
# Extra files to include | |
# | |
myExtraIncludes = ".tm_properties,.htaccess,.gitignore" | |
fileBrowserGlob = "{*,$myExtraIncludes}" | |
include = "{$include,$myExtraIncludes}" |
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
rails_env = ENV['RAILS_ENV'] | |
raise "Please specify RAILS_ENV." unless rails_env | |
rails_root = ENV['RAILS_ROOT'] || File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) | |
God.watch do |w| | |
w.dir = "#{rails_root}" | |
w.name = "resque-scheduler" | |
w.group = 'resque' | |
w.interval = 30.seconds | |
w.env = {"RAILS_ENV"=>rails_env, "BUNDLE_GEMFILE"=>"#{rails_root}/Gemfile"} |
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
# code inspired from http://jainmarket.blogspot.com/2009/05/creating-custom-table-view-cell.html | |
class CustomCell < UITableViewCell | |
attr_accessor :primaryLabel | |
attr_accessor :secondaryLabel | |
def createLabels | |
@primaryLabel = UILabel.alloc.init |
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 MyCustomCell < UITableViewCell | |
# This method is used by ProMotion to instantiate cells. | |
def initWithStyle(style_name, reuseIdentifier: reuseIdentifier) | |
super | |
stylish | |
self | |
end | |
# A delegate method when the user clicks the Row(it's blue by default) |
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
using System; | |
using System.Drawing; | |
using System.IO; | |
using System.Net; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
// A MonoTouch iOS Mail like example with a custom view and a UIWebView : | |
// | |
// http://stackoverflow.com/questions/10434444/zoom-a-uiwebview-like-ios-mail-app/10463431 |
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
Show hidden characters
{ | |
// "auto_complete_commit_on_tab": true, | |
"auto_complete": true, | |
"tab_completion": true, | |
// "bold_folder_labels": true, | |
// "color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", | |
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ |
OlderNewer