Skip to content

Instantly share code, notes, and snippets.

View khelll's full-sized avatar

Khaled alHabache khelll

View GitHub Profile
khelll@khelll-laptop:~/projects/merb-book$ git rebase mattetti/master
book-content/ar/toc.markdown: needs update
gems/bin/autospec: needs update
gems/bin/edit_json.rb: needs update
gems/bin/erubis: needs update
gems/bin/gpgen: needs update
gems/bin/maruku: needs update
gems/bin/marutex: needs update
gems/bin/merb: needs update
gems/bin/mongrel_rails: needs update
#!/usr/bin/ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'growl'
# Configuration
#
# URL to get questions from
@@v = 1
class MyClass
@@v = 2
end
@@v #=>2
class Spot
include Mongoid::Document
include Mongoid::Timestamps
## Fields ##
field :name_t
## Associations ##
embeds_many :items
testing
# Default ruby is 1.9.3, but opening a new shell results in having 1.9.2 instead!
~|⇒ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
~|⇒ rvm list default
Default Ruby (for new shells)
ruby-1.9.3-p125 [ x86_64 ]
@khelll
khelll / praytimes.py
Created January 14, 2014 21:51
Fix for the python code version 2 of the Pray Times algorithm http://praytimes.org/code/
#!/usr/bin/env python
# compatible with python 2.x and 3.x
import math
import re
'''
--------------------- Copyright Block ----------------------
praytimes.py: Prayer Times Calculator (ver 2.3)
@khelll
khelll / install-redis.sh
Last active March 12, 2024 08:33
Installing Redis on Amazon Linux
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=3.2.0
echo "*****************************************"
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make"
@khelll
khelll / nginx
Created January 10, 2015 05:12
A start / stop script for Nginx on Amazon Linux
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: nginx initscript
# Description: nginx
### END INIT INF
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: nginx initscript
# Description: nginx
### END INIT INF