Skip to content

Instantly share code, notes, and snippets.


Joe H. Rahme joehakimrahme

  • Red Hat
  • Milano
View GitHub Profile
View gist:593b2ce886f4ff8ca24a04c939ab433e
~/src/Game_of_Life% git diff
diff --git a/script.js b/script.js
index a57a343..5045273 100644
--- a/script.js
+++ b/script.js
@@ -14,12 +14,12 @@ c.lineWidth=2;
function addsquare(){
- c.fillRect(302,302,46,46);
View gist:787a24a148d3066c432e753aa6255c60
// Write a function that prints the n first even numbers starting with 0
function printPilou(y) {
function partialPilou(n, i) {
if (n == 0) {
partialPilou(n-1, i+2);
partialPilou(y, 0);
# name:
# Creates a minimal environment based on the host binaries. So far
# this has only been tested on Fedora27
set -xe
default_bins="ls bash env cat less"
View gist:7d51d9668c6941aafe35
ConVarRef dota_workshoptools_limited_ui doesn't point to an existing ConVar
Did not detect any valid joysticks.
Using AudioQueue Interface
Wave sound initialized
Trying cache : '/Users/joehakimrahme/Library/Application Support/Steam/SteamApps/common/dota 2 beta/dota/sound/sound.cache'
m_mapGameModeDetails contains 0 items
Loaded default backpack filters.
Restarting sound playback
[SteamDatagramClient] Got network config from CDN. Loaded revision 9 OK
In logon queue; waiting for GC to confirm connection.
import voluptuous
import yaml
schema = voluptuous.Schema({
voluptuous.Required("name"): str,
"sex": voluptuous.Any("Male", "Female", "N/A"),
"class": str,
"title": str,
"hp": [int],
View index.rst

Bienvenue à la documentation de Hy !

Hy logo

joehakimrahme / staticweb blog
Created Sep 18, 2013
Create 3 files and upload them to a Swift container
View staticweb blog
$ cat index.html
<h1>Index file</h1>
<p>This is the index.html file.</p>
$ cat listing.css
h1 {color: red;}
$ cat 404error.html
<h1>404 File not found!</h1>
<p>We couldn't locate the file you're asking for.</p>
joehakimrahme / Random theme loader
Last active Jun 8, 2017
I created this function to apply a random theme to Emacs.
View Random theme loader
(defun load-random-theme ()
"Load any random theme from the available ones."
;; disable any previously set theme
(if (boundp 'theme-of-the-day)
(disable-theme theme-of-the-day)
(makunbound 'theme-of-the-day)))
View gist:5885156
(defn trampoline [func]
(defn trampolined-func [*args]
(setv f (func *args))
(while (callable f)
(setv f (f)))
(with-decorator trampoline
View gist:5853968

yield without the do

=> (defn foo [n]
... (if (< n 10) (yield n)))
Traceback (most recent call last):
  File "/Users/joehakimrahme/.venv/hy/lib/python2.7/site-packages/hy/", line 45, in ast_compile
    return compile(ast, filename, mode, __future__.CO_FUTURE_DIVISION)
SyntaxError: 'return' with argument inside generator (<console>, line 2)