Skip to content

Instantly share code, notes, and snippets.

View phoenixwizard's full-sized avatar

Aram Bhusal phoenixwizard

View GitHub Profile
@phoenixwizard
phoenixwizard / array_flatten.rb
Created November 8, 2016 08:33
Array Flatten
require 'json'
def flatten_current_array(array,new_array)
if array.class == Array
array.each do |elem|
flatten_current_array(elem,new_array)
end
else
new_array.push(array)
end
=begin
Notes
=====
Labels: On the label you should put a "for" attribute if you're not using something like simple_form
This helps capybara to find your field
e.g. <label for="my_field_id">Some label</label>
=end
field = "Label on my field"
value = "existing option in list"
</Proxy *>
AddDefaultCharset off
Order deny,allow
Deny from all
Allow from localhost
</Proxy>

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@phoenixwizard
phoenixwizard / gist:3267189
Created August 5, 2012 21:26 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@phoenixwizard
phoenixwizard / gist:3197111
Created July 29, 2012 09:45 — forked from danparsons/gist:3195652
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@phoenixwizard
phoenixwizard / show_hidden_file.txt
Created July 16, 2012 10:56
Show hidden Files in osx Lion
This one will show all unix hidden files i.e. files starting with a dot (.)
defaults write com.apple.finder AppleShowAllFiles TRUE
Next run
killall Finder
Now the finder will be relaunched and *tadaa* your hidden files are visible.
@phoenixwizard
phoenixwizard / launch_sublime_from_terminal.markdown
Created July 16, 2012 10:27 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation