Skip to content

Instantly share code, notes, and snippets.

View orlin's full-sized avatar

Orlin M Bozhinov orlin

  • Astrolet
  • Varna, Bulgaria
  • X @orlin
View GitHub Profile
@orlin
orlin / keybase.md
Created October 18, 2014 10:33
keybase.io proof

Keybase proof

I hereby claim:

  • I am orlin on github.
  • I am oto (https://keybase.io/oto) on keybase.
  • I have a public key whose fingerprint is FF9D 930D 4C0E 8D13 3530 BE27 B98F 2818 012A AB0B

To claim this, I am signing this object:

@orlin
orlin / rakefile.rb
Created December 11, 2009 12:59
auto-compressed sprockets
#!/usr/bin/env ruby
#
# sprockets watch
#
# changed to:
# * use yui/compressor
# * load config/sprockets.yml
# * rake watch[lib/javascripts,public/javascripts,sprockets,config/sprockets.yml]
#
# ------------------------------------------------------
@orlin
orlin / config.ru
Created February 17, 2010 14:01
Heroku Maintenance Mode
# $ heroku maintenance:on
# $ heroku maintenance:off
# side-effect for any GETs during and then after Maintenance Mode ...
# the maintenance page stays cached (in place of the real ones) - until: Cmd + Shift + R
require 'rubygems'
if ENV['MAINTENANCE_MODE']
require 'rack'
# config.ru
begin
# Try to require the preresolved locked set of gems.
require File.expand_path('../.bundle/environment', __FILE__)
rescue LoadError
# Fall back on doing an unlocked resolve at runtime.
require "rubygems"
require "bundler"
Bundler.setup
@orlin
orlin / Guardfile
Created December 6, 2010 13:08
CoffeeScript + Jim bundles / Guard
guard 'coffeescript', :output => 'app/javascripts', :wrap => false, :shallow => false do
watch('^app/coffeescripts/(.*)\.coffee')
end
def jimify(bundles, why = nil)
bundles = Array(bundles)
message = "Jim bundle & compress (bundles: #{bundles.join(", ")})"
message += " due to #{why} change" if why
puts message
# just bundle them first, so that livereload happens faster
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
@orlin
orlin / undermix.coffee
Created December 15, 2010 18:59
underscore.js with strings and other mixins (a node.js module)
define (require, exports, module) ->
_ = require("underscore")
_.mixin require("underscore.string")
_.mixin
# Converts the arguments list to an Array
aToArr: (list) ->
if _.isArguments(list)
_.toArray(list).slice(0)
else
@orlin
orlin / isHappyReady.coffee
Created February 4, 2011 20:34
trying get going with happy.js validation
$(document).ready ->
$('#enlist').iphoneStyle
checkedLabel: 'For Sure'
uncheckedLabel: 'No Thanks'
resizeContainer: false
resizeHandle: false
$('input[type="text"]:first').focus()
@orlin
orlin / _5.sass
Created February 16, 2011 17:12
less framework 3 + compass-less-plugin (a few of the partials) + my mixins & usage
/* 5-column layout
* For 480 px mobiles, narrow browsers, and landscape iPhones. */
@media only screen and (max-width: 767px) and (min-width: 480px)
body
@include grid(5)
@include mobile-safari
+whole
.torso
@orlin
orlin / _view.coffee
Created August 17, 2011 09:21
Backbone.history.start() # see index.coffee - error
class exports.RootView extends Backbone.View
el: $ '#container'
template: '_.jade'
initialize: ->
_.bindAll @render
render: ->
$(@el).empty()
$(@el).append jadeify @template