Skip to content

Instantly share code, notes, and snippets.

View compermisos's full-sized avatar

Jesus Christian Cruz Acono compermisos

  • Tlaxcala, Mexico
View GitHub Profile
@banksean
banksean / mersenne-twister.js
Created February 10, 2010 16:24
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@maop
maop / ws.sh
Created September 23, 2010 05:10
#!/bin/bash
# ws.sh Web Server in Shell Scripting
# @author: maop www.maop.mx
# INSTALL: Just add to your /etc/inetd.conf:
# http-alt stream tcp nowait nobody /home/maop/Proyectos/ws-sh/ws.sh
# restart inetd and launch your browser to 127.0.0.1:8080
# --[ Config ]--
htdocs="/home/maop/Proyectos/ws-sh"
@mattrude
mattrude / changepassword.php
Created October 31, 2010 23:49
LDAP PHP Change Password Page
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991
@ewilderj
ewilderj / friends.py
Created December 9, 2010 18:19
Make a graph of your social network from those you follow
# a messy hack written by Edd Dumbill. http://twitter.com/edd
# You may need to rerun this script if you hit a Twitter Error because you
# use up API rate limiting. That's why we pickle the results, so we can resume
# where we left off.
# get the twitter module using 'easy_install twitter'
from twitter.api import Twitter, TwitterError
from twitter.oauth import OAuth
@Thinkscape
Thinkscape / PSR-0-final-proposal.md
Created September 22, 2011 10:30
PSR-0 Final Proposal (PHP Standards Working Group)

PSR-0 Final Proposal (PHP Standards Working Group)

The following describes the mandatory requirements that must be adhered to for autoloader interoperability.

Mandatory:

  • A fully-qualified namespace and class must have the following structure \ <Vendor Name> \ (<Namespace>)* \ <Class Name>
  • Each namespace must have a top-level namespace ("Vendor Name").
  • Each namespace can have as many sub-namespaces as it wishes.
  • Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system.
  • Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace.
@miguelrios
miguelrios / fb_sec.sh
Created February 1, 2012 20:29
Bash script that checks if Facebook posted their IPO papers to the SEC every 10 seconds (warning, very naive approach, make it better).
#!/bin/sh
URL='http://www.sec.gov/cgi-bin/browse-edgar?company=facebook&match=&CIK=&filenum=&State=&Country=&SIC=&owner=exclude&Find=Find+Companies&action=getcompany'
alias fb_sec='curl $URL'
PREIPO=`fb_sec`
while : ;
do
sleep 10s
IPO=`fb_sec`
if [[ "$IPO" != "$PREIPO" ]]
@gcorreaq
gcorreaq / README.md
Last active November 3, 2022 23:59
Función en Python para transformar números romanos a arabigos
@markprovan
markprovan / crawler.rb
Created February 1, 2012 20:45
Crawler
require 'net/http'
require 'open-uri'
require 'nokogiri'
require 'uri'
class Crawler
attr_accessor :visited_links, :links_to_visit
def initialize(starting_link)
self.visited_links = []
self.links_to_visit = []
@jayrambhia
jayrambhia / playBanshee.py
Created February 1, 2012 20:48
A python script to play banshee media player(can use only terminal commands).
'''
Author : Jay Rambhia
email : jayrambhia777@gmail.com
twitter: @jayrambhia
'''
import os
import time
import threading
import sys
from multiprocessing import Process
@jayrambhia
jayrambhia / stickynote.py
Created February 13, 2012 20:38
A simple sticky note application using pygtk!
import pygtk
pygtk.require('2.0')
import gtk
import os
class TextBox:
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_size_request(200,250)
self.window.connect("destroy", self.close_application)