Skip to content

Instantly share code, notes, and snippets.

View nibrahim's full-sized avatar

Noufal Ibrahim nibrahim

View GitHub Profile
@nibrahim
nibrahim / gist:2466292
Created April 22, 2012 19:21
Screencast make rules
ARCHIVE_DIR=/home/noufal/projects/emacsmovies.org/videos
all: generate archive
upload: generate
curl --location --header "authorization: LOW xxxx:yyyy" --upload-file ./${number}-episode-${name}.webm http://s3.us.archive.org/EmacsMovies/${number}-episode-${name}.webm
curl --location --header "authorization: LOW xxxx:yyyy" --upload-file ./${number}-episode-${name}.mkv http://s3.us.archive.org/EmacsMovies/${number}-episode-${name}.mkv
archive: ${number}-episode-${name}.webm
@nibrahim
nibrahim / pygments-pygame.py
Created January 10, 2011 19:24
Using pygments to highlight code for use in pygame Using pygments to highlight code for use in pygame
#!/usr/bin/env python
import pygame
from pygame.locals import *
from pygame.color import Color
from pygments.lexers import PythonLexer
from pygments.styles.emacs import EmacsStyle
@nibrahim
nibrahim / mystery.py
Created May 10, 2021 19:30
Example program for genskill bootcamp
import time
l = 20
q = ['.']*l
i = 0
f = 1
while True:
i+=1
p = q[:]
m = q[:]
@nibrahim
nibrahim / program.c
Created May 9, 2021 17:56
Example program for Genskill training.
#include <stdio.h>
void delay( unsigned int value)
{
unsigned int count1 =0;
unsigned int count2 = 0;
for(count1 = 0; count1 < value ; count1++ )
{
for(count2 = 0; count2 < count1 ; count2++ )
#include <stdio.h>
int
main ()
{
printf ("Hello, world!\n");
return 0;
}
@nibrahim
nibrahim / ep
Created October 18, 2016 11:27
Pipe output of commands into Emacs
#!/usr/bin/env python
import sys
import subprocess
PIPE_BUFFER_NAME="*piped*"
def execute_command(c):
cmd = ["/usr/bin/emacsclient", "-n", "-e", c]
p = subprocess.Popen(cmd, stdout=subprocess.DEVNULL)
** Introduction (all the points inside Setup)
- Introduction to domain - user stories
- A book club
- Users
- Create a user
- User should be able to login
- Books
- Decide on fields that a book should have
- User should be able to add a books
- User should be able to list books
import subprocess
import datetime
import urllib.request
def interesting_commodity(commodities, line):
"""Returns True if the given line has one of the given commodities"""
for c in commodities:
if c in line:
return True
return False
import json
import math
import sys
#import pprint
## You should probably close the file before returning d here. Use a
## with statement
def parse_file(filename):
f = open(filename, "rt")
@nibrahim
nibrahim / example.geojson
Last active January 27, 2017 11:06
Playing with geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.