Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jattoabdul's full-sized avatar
👑
ruling the world

Jatto Abdulqahhar jattoabdul

👑
ruling the world
View GitHub Profile
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@gbozee
gbozee / fizzbuzz.py
Created October 7, 2017 17:35
Testing Python programs with unittest
import unittest
class FizzBuzzException(Exception):
pass
def fizz_buzz(param):
result = ""
try:
variable = int(param)
except ValueError:
@Irio
Irio / gist:1496746
Created December 19, 2011 11:24
Solution for "cannot load such file -- openssl" on RVM
When I tried run "rake test", I received:
rake aborted!
cannot load such file -- openssl
Tasks: TOP => test:units => test:prepare => db:test:prepare => db:abort_if_pending_migrations => environment
(See full trace by running task with --trace)
@zefer
zefer / mongoid_money_usage.rb
Created February 23, 2011 14:46
Money represented with the Money gem, persistence using Mongoid
class Product
include Mongoid::Document
include Mongoid::Timestamps
field :description, :type => String
field :price_pence, :type => Integer, :default => 0
field :currency_iso, :type => String, :default => Money.default_currency.iso_code
validates_presence_of :description
@jnunemaker
jnunemaker / harmony.rb
Created November 10, 2009 01:20
simple app configuration
module Harmony
# Allows accessing config variables from harmony.yml like so:
# Harmony[:domain] => harmonyapp.com
def self.[](key)
unless @config
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml")
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys
end
@config[key]
end