Skip to content

Instantly share code, notes, and snippets.

View joehakimrahme's full-sized avatar

Joe H. Rahme joehakimrahme

  • Red Hat
  • Milano
View GitHub Profile
~/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);
// Write a function that prints the n first even numbers starting with 0
function printPilou(y) {
function partialPilou(n, i) {
if (n == 0) {
return
}
console.log(i);
partialPilou(n-1, i+2);
}
partialPilou(y, 0);
#!/bin/sh
# name: mkjail.sh
# 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"
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],
@joehakimrahme
joehakimrahme / index.rst
Last active January 4, 2016 15:09
Index FR

Bienvenue à la documentation de Hy !

Hy logo

@joehakimrahme
joehakimrahme / staticweb blog
Created September 18, 2013 09:55
Create 3 files and upload them to a Swift container
$ 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
joehakimrahme / Random theme loader
Last active June 8, 2017 01:44
I created this function to apply a random theme to Emacs.
(defun load-random-theme ()
"Load any random theme from the available ones."
(interactive)
;; disable any previously set theme
(if (boundp 'theme-of-the-day)
(progn
(disable-theme theme-of-the-day)
(makunbound 'theme-of-the-day)))
(defn trampoline [func]
(defn trampolined-func [*args]
(setv f (func *args))
(while (callable f)
(setv f (f)))
f)
trampolined-func)
(with-decorator trampoline

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/importer.py", line 45, in ast_compile
    return compile(ast, filename, mode, __future__.CO_FUTURE_DIVISION)
SyntaxError: 'return' with argument inside generator (<console>, line 2)