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
module RubyMotionQuery | |
module Stylers | |
class UIPageControlStyler < UIControlStyler | |
# Your custom styler methods here | |
def current_page | |
view.currentPage | |
end | |
def current_page=(value) |
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
require 'mini_magick' | |
image = MiniMagick::Image.open("big_color.jpg") | |
image.resize"128x64^" #resize but retain aspect ratio | |
image.depth 1 | |
image.format 'bmp' | |
image.colorspace 'gray' | |
image.write "grayscale.bmp" |
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
for prefix in ['i', 'n', 'v'] | |
for key in ['<Up>', '<Down>', '<Left>', '<Right>'] | |
exe prefix . "noremap " . key . " <Nop>" | |
endfor | |
endfor |
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
javascript:(function(g,d,f){if(f)d.info("Session found:",f);else return d.warn("No session found!");var h={check:10,wait:500},b=g.autodj={api:g[f],available:function(a){return b.api.taken_dj_map[a]<0},spot:function(){return b.api.become_dj.data("spot")},become:function(a){b.api.callback("become_dj",a)},waiter:function(a){return function(){return b.available(a)?(b.become(a),a):(d.info("Waiting..."),-1)}},seated:function(a){return b.api.djs[a]&&b.api.djs[a][0]===b.api.myuserid},wait:function(a,c){var e=c!==void 0, | |
a=a||h.check,c=c||b.spot();b.seated(c)?d.warn("Spot",c,"taken!"):(e&&d.error("Spot",c,"missed. Restarting..."),d.info("Polling @",a,"ms"),b.check(a,b.waiter(c)))},check:function(a,c){setTimeout(function(){var e=c.call(b);e>0?(d.warn("Spot",e,"open..."),setTimeout(function(){b.wait(a,e)},h.wait)):b.check(a,c)},a)}}})(window,console,function(g,d,f,h,b,a,c,e,i,j,k){try{return g(d)[f](h)[b][a][c][e]()[i](j)[k]}catch(l){return null}}(jQuery,".invite_dj","data","events","click",0,"handler","toString","match |
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
sudo apt-get install git vim-nox | |
cd | |
git clone git@github.com:mattsgarrison/Dotfiles.git | |
ln -s ~/Dotfiles/vimrc ~/.vimrc | |
vim |
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
Number::seconds = -> | |
@ * 1000 | |
Number::minutes = -> | |
@seconds() * 60 | |
Number::minute = Number::minutes | |
Number::hours = -> | |
@minutes() * 60 |
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
find . -size +20000k -exec du -h {} \; |
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
<%-# This is the default way the file puts post content on the page. %> | |
<%= @post.body.html_safe %> | |
<%-# This is the replacement for that line. %> | |
<%= raw @post.body.html_safe.gsub(/\[gist:(\d+)(\,)(.+)\]/,"<script src='https://gist.github.com/\\1.js?file=\\3'></script>") %> |
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
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project' | |
require 'bubble-wrap' | |
Motion::Project::App.setup do |app| | |
# Use `rake config' to see complete project settings. | |
app.name = 'Chatoms' | |
app.version = "2.0" | |
app.deployment_target = '5.1' | |
app.identifier = "com.iconoclastlabs.chatoms" |
OlderNewer