Skip to content

Instantly share code, notes, and snippets.

View unamashana's full-sized avatar

Hana Mohan unamashana

View GitHub Profile
This Privacy Policy governs the manner in which hackin.at collects, uses, maintains and discloses information collected from users (each, a "User") of the http://hackin.at website ("Site"). This privacy policy applies to the Site and all products and services offered by hackin.at.
Personal identification information
We may collect personal identification information from Users in a variety of ways, including, but not limited to, when Users visit our site, register on the site, and in connection with other activities, services, features or resources we make available on our Site. Users may be asked for, as appropriate, name, email address. Users may, however, visit our Site anonymously. We will collect personal identification information from Users only if they voluntarily submit such information to us. Users can always refuse to supply personally identification information, except that it may prevent them from engaging in certain Site related activities.
Non-personal identification information
We may coll
<html>
<body>
<div id="player"></div>
<script type="text/javascript">
Muziboo.Player.embedSingle(); // Won't work as my_javascript_files are not loaded yet
</script>
<script type="text/javascript" src="my_javascript_files"></script>
</body>
</html>
<html>
<script type="text/javascript">
_muzq ||= []
</script>
<body>
<div id="player"></div>
<script type="text/javascript">
_muzq.push(['Muziboo.Player.embedSingle']); // The queue will store this message until the javascript is loaded
</script>
Muziboo.Queue = {
process: function(){
_muzq.each(function(e){
Muziboo.Queue.execute(e);
});
// Queue is no longer needed as the stack is ready
_muzq = {
push: function(e){
@unamashana
unamashana / hsi_notifications
Created February 3, 2011 18:28
Email notifications for HackerStreet India
require 'rubygems'
require 'rb-inotify'
require 'sqlite3'
require 'active_record'
require 'mail'
require 'log4r'
include Log4r
MYLOG = Logger.new 'mylog'
file = FileOutputter.new('fileOutputter', :filename => 'hsi_notifications.log', :trunch => false)
Then I should see :"flash.success.admin_signup" with email: "joedoe@example.com", first_name: "Joe"
Then /^I should see :"([^\"]*)"(?: with #{capture_fields})?$/ do |text, fields|
if page.respond_to? :should
page.should have_content(I18n.t(text, eval("{#{fields}}")))
else
assert page.has_content?(I18n.t(text, eval("{#{fields}}")))
end
end
bundle config build.mysql --with-mysql-config=/usr/local/bin/mysql_config
@unamashana
unamashana / jasmine.yml
Created July 5, 2011 05:24
Jammit and Jasmine
src_files:
# For CI
- public/assets/common.js
- public/assets/app_assets.js
- public/assets/app.js
- public/javascripts/testing/sinon-1.1.0.js
- public/javascripts/testing/jasmine-sinon.js
- public/javascripts/testing/backbone-factory.js
- public/javascripts/testing/backbone_mocks.js
@unamashana
unamashana / js2cs.rb
Created July 6, 2011 05:15
Converting a Javascript Project to CoffeeScript
#SRC_BASE_DIR = "public/javascripts/backbone"
#DEST_BASE_DIR = "app/coffeescripts/backbone"
SRC_BASE_DIR = "spec/javascripts"
DEST_BASE_DIR = "spec/coffeescripts"
JS2COFFEE = "~/node_modules/js2coffee/bin/js2coffee"
dirs = []
files = []
Dir.glob("#{SRC_BASE_DIR}/**/*.js").each do |file|
SB.Collections.TicketList = Backbone.Collection.extend({
model: SB.Models.Ticket,
url: "/tickets",
name: "tickets"
}