Skip to content

Instantly share code, notes, and snippets.

View rupakg's full-sized avatar
😎
drinking from the firehose...

Rupak Ganguly rupakg

😎
drinking from the firehose...
View GitHub Profile
@emad-elsaid
emad-elsaid / weather.rb
Created February 21, 2014 14:53
get wheather of any city using ruby
require 'open-uri'
require 'json'
require 'psych'
city = 'portsaid,egypt'
request = "http://api.openweathermap.org/data/2.5/weather?q=#{city}"
response = open(request).readlines.join
print Psych.dump( JSON.parse(response) )
@nathansmith
nathansmith / kill-magento-iframe.sass
Last active December 28, 2015 22:39
Hide unnecessary <iframe> in Magento.
// This matches any <iframe> that is used to overlay content.
//
// Example:
//
// <iframe style="... z-index ..."></iframe>
@media screen and (max-width: $media-mobile-max)
iframe[style*="z-index"]
display: none
# DOCKER-VERSION 0.6.4
# 13.10 - 04 has a missing ppa for postgresql 9.2 at the moment (26/10/2013)
FROM ubuntu:12.10
MAINTAINER Sam Saffron "https://twitter.com/samsaffron"
RUN apt-get -y update &&\
apt-get -y upgrade &&\
apt-get -y install software-properties-common &&\
@aaronksaunders
aaronksaunders / TiParse.js
Last active December 3, 2017 11:46
UPDATED PROJECT: http://bit.ly/1p61VRC Tested w/ latest version of parse "parse-1.2.18.js" I took a look at the latest Parse update to the APIs and they have made it even more complex to integrate Appcelerator and Facebook since they have integrated the FB Javascript API into the Parse Module directly.this hack just overrides the FB functions th…
/**
*
* Aaron K. Saunders
* twitter: @aaronksaunders
* last updated may 23, 2014
*
* See more Appcelerator Information on Clearly Innovative Blog
*
* www.clearlyinnovative.com
* blog.clearlyinnovative.com
@StefanH
StefanH / install_ruby.sh
Last active December 23, 2015 00:09
install ruby on precise64 vagrant box
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz
tar -xvzf ruby-1.9.3-p429.tar.gz
cd ruby-1.9.3-p429/
./configure --prefix=/usr/local
make
make install
@aaronksaunders
aaronksaunders / parse_fb_appcelerator.js
Created May 8, 2013 21:54
UPDATED FIX AVAILABLE HERE: http://bit.ly/1oaipIo Trying to create and link a facebook user to parse using appcelerator titanium. This solution listed below works BUT the question was removed from the Parse QA forum because I am using an undocumented method from an open source javascript library... don't quite understand that, but I am looking f…
// setting auth data retrieved from Ti.Facebook login
authData = {
"facebook" : {
"id" : Ti.Facebook.uid,
"access_token" : Ti.Facebook.accessToken,
"expiration_date" : expDate, // "format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
}
};
// Either way I resolved the problem, calling _handleSaveResult(true) on the returned user object,
@jfarmer
jfarmer / theory_of_learning.md
Last active May 6, 2023 22:55
Dev Bootcamp's Theory of Learning

How Dev Bootcamp Teaches: ActiveRecord

I'm Jesse, one of the co-founders of Dev Bootcamp, and the acting curricular editor-in-chief. We get lots of questions about how Dev Bootcamp approaches teaching, what our curriculum is like, and how it differs from other schools and competitors. I thought I'd share some of that with you, starting with a brief overview of our theory of learning and then sharing our introduction to ActiveRecord.

This will be light on theory and heavy on ActiveRecord, so if you're not familiar with SQL or Ruby it might be hard to follow. Mea culpa.

Dev Bootcamp's Theory of Learning

At Dev Bootcamp, we believe that "modeling" is central to learning. The most effective students have a clear model of how the world works and are able to quickly integrate new information int

@mkdynamic
mkdynamic / Rakefile
Last active December 10, 2015 11:09 — forked from jenslukowski/Rakefile
Including MailCore for RubyMotion project.
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'HelloMailCore'
# Configure MailCore
app.vendor_project("vendor/MailCore", :xcode, :headers_dir => "{../include,libetpan/build-mac/.build/include/libetpan}", :target => "MailCore iOS")
$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do
@rietta
rietta / domain_validator.rb
Created October 4, 2012 20:51
Rails 3 Bare Domain Validator
#
# Domain Validator by Frank Rietta
# (C) 2012 Rietta Inc. All Rights Reserved.
# Licensed under terms of the BSD License.
#
# To use in a validation, add something like this to your model:
#
# validates :name, :domain => true
#
class DomainValidator < ActiveModel::EachValidator