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
@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
@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" ]]
@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 / 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)
@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"
@mauropm
mauropm / README.txt
Created May 19, 2012 17:15
ProcessingJS app running on top of Phonegap on top of Windows Phone 7
README
(c) 2012 Mauro Parra-Miranda
This is an example of what you can do with processingjs+phonegap+windows phone. I hope you enjoy.
INSTALL INSTRUCTIONS
- Get the Windows Phone Development tools, no developer account needed to see this in the emulator: http://msdn.microsoft.com/en-us/library/ff402535(v=vs.92).aspx
- Get the latest phonegap (I'm using 1.7 now), from: http://phonegap.com/download
@nicordev
nicordev / domKiller.js
Last active May 20, 2019 06:31
Hide or remove DOM elements of a page by clicking on it (left click: hide, middle + left button: remove)
var domKiller = {
hiddenElements: [],
activated: false,
/**
* Initialize and activate the remove action when clicking simultaneously on left and middle mouse button and the hide action when clicking on the left mouse button
*/
init: function () {
@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.
@mkober
mkober / gist:1820269
Created February 13, 2012 20:47
Ways to prevent SQL Injections in PHP (for LV PHP Meetup)
// Ways to prevent SQL Injections in PHP (http://php.net/manual/en/security.database.sql-injection.php)
1. "Never connect to the database as a superuser or as the database owner. Use always customized users with very limited privileges."
2. "Check if the given input has the expected data type. PHP has a wide range of input validating functions, from the simplest ones found in Variable Functions and in Character Type Functions" (e.g. is_numeric(), ctype_digit()
3. "Quote each non numeric user supplied value that is passed to the database with the database-specific string escape function" (e.g. mysql_real_escape_string(), sqlite_escape_string(), etc.). "If a database-specific string escape mechanism is not available, the addslashes() and str_replace() functions may be useful (depending on database type)."
<?php
@ksaver
ksaver / spinner.sh
Last active May 26, 2020 10:11
A spinner in your terminal
#!/bin/bash
# spinner.sh
# A simple spinner in your terminal.
SPINS=(
"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgKiUlJSUlJSUlIyAgICAgICAgICAgICAgICAgICAgKCUlJSUlJSUlJSggICAgICAgICAgICAgICAKICAgICAgICAgICAgKiUlICAgLCgoKiAgICMlIyAgICAgICAgICAgICAgLiUlICAgKCUlJSguICAlJSwgICAgICAgICAgICAKICAgICAgICAgICAlJSAuJSUlJSUlJSUlJS8gLyUsICAgICAgICAgICAlJSAgJSUlJSUlJSUlJSUgICUlICAgICAgICAgICAKICAgICAgICAgICUoICUlJSMgLyUlKCAvJSUlIC4lJS8gICAgICAgIyUlICglJSUgIyUlJSggJSUlKCAlJSAg