Skip to content

Instantly share code, notes, and snippets.

View dgellow's full-sized avatar
🐢
Pulu pulu 🏳️‍🌈

Sam El-Borai dgellow

🐢
Pulu pulu 🏳️‍🌈
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Description: Permet le contrôle de la souris avec une manette.
#Author: Wrap http://linuxfr.org/users/wrap
# Originally posted at http://linuxfr.org/users/wrap/journaux/un-petit-script-pour-les-utilisateurs-de-manette
import pygame
from pygame.locals import *
import Xlib,time
From AMFPN@NEUVM1.BITNET Tue Oct 31 20:46:54 1989
From: Per Nielsen <AMFPN@NEUVM1.BITNET>
Subject: Hacker test (was: Forwarded mail for FREETALK)
1
THE HACKER TEST - Version 1.0
<html>
<head>
<title>Hello react</title>
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/foundation/5.0.2/css/foundation.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.8.0/react.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script>
</head>
<body>
dom = React.DOM
CommentBox = React.createClass
getInitialState: ->
{data: []}
loadCommentsFromServer: ->
$.ajax
url: 'comments.json',
@dgellow
dgellow / animation-draft.el
Created January 27, 2014 14:20
Playing with a ascii art animation.
(setq lines-data '(("-" (lambda (y-offset)(* 1 y-offset)))
("=" (lambda (y-offset)(* 2 y-offset)))))
(defun exec-cdr ()
(mapc (lambda (c) (message "Value: %S" (nth 1 c))) lines-data)
(funcall (cadar lines-data) 10))
(defun line-down-repeat ()
(dotimes (iteration 5)
(dotimes (n steps)
(defn polling [fun]
(println "[polling] started")
(loop []
(if (not (realized? fun))
(recur)))
(println "[polling] result: " (deref fun))
(println "[polling] end")
(deref fun))
(do
// Define a class
AwesomeClass = function () {
this.hello = function(param) {
console.log("[base method] ", param);
return param;
};
};
// Create an instance
awesome_object = new AwesomeClass();
@dgellow
dgellow / predicat_totem.py
Created March 3, 2014 09:53
Get only tweets tagged as 'fixme'
def filter_fixme(data):
return filter(
lambda x: 'fixme' in x.get('tags', []), data
)
function Point(x, y, proto) {
var p = Object.create(proto || Point.prototype);
p.x = x;
p.y = y;
return p;
};
Point.prototype = {
if (!window.app) {
window.app = {}
}
window.app.Cow = function(name) {
this.name = name || 'Anon cow';
}
window.app.Cow.prototype = {
greets: function(target) {