Skip to content

Instantly share code, notes, and snippets.

View roramirez's full-sized avatar

Rodrigo Ramírez Norambuena roramirez

View GitHub Profile
@Ocramius
Ocramius / Rand.php
Created April 14, 2011 13:23
MySQL RAND() function in Doctrine2 DQL
<?php
namespace My\Custom\Doctrine2\Function;
/**
* RandFunction ::= "RAND" "(" ")"
*/
class Rand extends FunctionNode
{
public function parse(\Doctrine\ORM\Query\Parser $parser)
@tkihira
tkihira / gist:2367067
Created April 12, 2012 13:02
rmdir recursively in node.js
var fs = require("fs");
var path = require("path");
var rmdir = function(dir) {
var list = fs.readdirSync(dir);
for(var i = 0; i < list.length; i++) {
var filename = path.join(dir, list[i]);
var stat = fs.statSync(filename);
if(filename == "." || filename == "..") {
@fxsjy
fxsjy / SimpleAuthServer.py
Created April 26, 2013 06:23
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@camelaissani
camelaissani / rmdir-recursive.js
Last active December 27, 2016 21:08
Makes a recursive rmdir in nodejs
var fs = require('fs');
function rmdirSync(dir) {
var currentDirToRead,
directoriesFound,
nextDirToReadIndex;
if (!fs.existsSync(dir)) {
return;
}
@morozgrafix
morozgrafix / MagicMirror_on_CHIP.md
Created January 28, 2017 08:49
MagicMirror on $9 C.H.I.P. Installation Instructions
@roramirez
roramirez / MagicMirror_on_CHIP.md
Created January 30, 2017 16:13 — forked from morozgrafix/MagicMirror_on_CHIP.md
MagicMirror on $9 C.H.I.P. Installation Instructions