Skip to content

Instantly share code, notes, and snippets.

View spritle's full-sized avatar

Spritle Software spritle

View GitHub Profile
@spritle
spritle / Install_tmux
Created February 24, 2014 12:26 — forked from simme/Install_tmux
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@spritle
spritle / delayed_job.rb
Last active August 29, 2015 14:17 — forked from german/gist:1237902
# run with: god -c /path/to/config.god [add -D if you want to not-deamonize god]
# This is the actual config file used to keep the delayed_job running
APPLICATION_ROOT = "/var/www/application"
RAILS_ENV = "production"
God.watch do |w|
w.name = "delayed_job_production"
w.interval = 15.seconds
w.start = "/bin/bash -c 'cd #{APPLICATION_ROOT}/current; /usr/bin/env RAILS_ENV=#{RAILS_ENV} #{APPLICATION_ROOT}/current/script/delayed_job start > /tmp/delay_job.out'"
{"response":[{"id":36,"name":"Sync Test","client_name":"Eventstream","created_at":"2015-06-25T14:16:58.943Z","updated_at":"2015-07-27T11:38:42.683Z","event_date":"06/25/2015","local_ip_address":"","local_stream_name":"","local_port":0,"live_stream_name":"synctest1","active_twitter":false,"twitter_handle":"#toronto","allow_live_streaming":false,"event_id":"SYNCTEST1","allow_event_access":true,"live_wowza_url":"http://cdn.kastio.com/livetouch","record_on_server":false,"playback_recording":false,"allow_remote_vod_streaming":true,"vod_filename":"uploads/1435241756252-jahidqqvzhbyb9-061ec137210e43cf42d4bea36a03f96f/synctest.mp4","allow_local_streaming":false,"local_protocal":"udp","local_mode":"Multicast","local_wifi_ssid":"","vod_wowza_url":"http://cdn.kastio.com/livetouch-vods3/_definst_/mp4:amazons3/livetouch-vod","vod_filename_suffix":"playlist.m3u8","single_camera_view":true,"overlay_title":"Sync Test","overlay_message":"Working Fine...!!!","overlay_date_time":"2015-07-14 19:08:00","overlay_enabled":true,"liv
@spritle
spritle / tip1__mechanize_screenscrap.rb
Created April 20, 2010 03:57
mechanize with form login
require 'mechanize'
mechanize_agent = Mechanize.new
# Visit login page
mechanize_agent.get('http://www.cmsimple.org/demo/?Welcome&login') do |page|
remote_login_form = page.form('login')
remote_login_form.passwd = "test"
# Click submit to login
mechanize_agent.submit(remote_login_form, remote_login_form.buttons.first)
# Access the protected page - Settings
@spritle
spritle / gist:1042243
Created June 23, 2011 09:35 — forked from otype/gist:137347
Memcached in Ruby
require 'rubygems'
require 'memcache'
class Memcaching
def initialize
@cache = MemCache.new 'localhost:11211', :namespace => 'goofingaroundwithmemcached'
end
def load_key_into_memcache(key,value)
@spritle
spritle / from_ipad2_choose_picture_to_webapp
Created October 25, 2011 06:02
Upload image from Rhodes and read exif.gps data using RoR
------------inspect exif_info.exif--------------
[{:orientation=>#<EXIFR::TIFF::Orientation:TopLeft(1)>, :color_space=>1, :pixel_x_dimension=>320,
:pixel_y_dimension=>239}]
-----------inspect exif_info.gps--------------
nil
@spritle
spritle / redis.rb
Created July 17, 2012 11:32
Redis test
require "redis"
redis = Redis.new(:host => "localhost", :port => 6379)
redis.set "foo", "bar"
redis.get "foo"
@spritle
spritle / scan.rb
Created October 15, 2012 12:50
Scanner Code
#application.rb
# Avoid, the scanner gets auto started when device starts up.
# Avoid, the scanner gets auto started when application start.
def on_activate_app
begin
Scanner.stop
rescue
end
end
#app/layout.erb
@spritle
spritle / dabblet.css
Created October 26, 2012 05:27
zig-zag background (SO)
/**
* zig-zag background (SO)
* CSS Zigzag Border with a Textured Background
*/
background: linear-gradient(#EFF0F3 49%, transparent 49%),
linear-gradient(-45deg, white 33%, transparent 33%) 0 50%,
white linear-gradient(45deg, white 33%, #EFF0F3 33%) 0 50%;
background-repeat: repeat-x;
background-size: 1px 100%, 40px 40px, 40px 40px;
@spritle
spritle / capitalize_text.js
Created February 20, 2013 11:38
It is a small and simple plugin which Capitalize all the text inside a table. The plugin also has the option to convert all words to small letters.
(function($) {
$.fn.tableCap = function(params) {
params = $.extend( {lower : false, toggle : true}, params);
var selectedElement = $(this);
toggleText = (function (convert) {
$('tr td',selectedElement).each(function () {
convert($(this).html(), $(this))
});