Skip to content

Instantly share code, notes, and snippets.

View twilight1794's full-sized avatar
πŸ§ƒ
Sic parvis, magna

Giovanni Alfredo Garciliano DΓ­az twilight1794

πŸ§ƒ
Sic parvis, magna
View GitHub Profile
@mpasternacki
mpasternacki / pingfcgi.sh
Created October 13, 2009 18:40
Ping FCGI server, using cgi-fcgi program from libfcgi library.
#!/bin/sh
set -e
# Ping FCGI server. Uses cgi-fcgi program from libfcgi library.
# Retrieves the root path (/) from host:port specified on command line.
if [ -z "$1" ] ; then
echo "Usage: $0 host:port|path/to/socket" >&2
exit 1
fi
@mowen
mowen / org-style.css
Created March 9, 2010 12:19
A stylesheet for the Emacs Org Mode HTML export
/**
* This stylesheet will work pretty well with a regular Org Mode HTML export.
* However, you do have to turn off all of the defaults:
*
* (setq org-export-html-style-include-scripts nil
* org-export-html-style-include-default nil)
*
* and insert a call to the stylesheet:
*
* (setq org-export-html-style
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@gabetax
gabetax / example.html
Created January 30, 2012 05:42
XHTML to Markdown XSLT Translation
<html>
<body>
<h1>Our Navigation</h1>
<p>I'm writing an example xhtml document to get converted into markdown!</p>
<h2>Examples</h2>
<h3>Text formatting</h3>
<p>Sometimes with longer <em>paragraphs</em><br/>we just want a new line <strong>immediately</strong>.</p>
<div>Divs are block elements too, and people don't always put their text in p tags.</div>
@fabiand
fabiand / SimpleHTTPPutServer.py
Last active November 26, 2024 06:30
A simple HTTP Server supporting put (python3)
# python3 -m SimpleHTTPPutServer 8080
from http.server import HTTPServer, SimpleHTTPRequestHandler
class PutHTTPRequestHandler(SimpleHTTPRequestHandler):
def do_PUT(self):
print(self.headers)
length = int(self.headers["Content-Length"])
path = self.translate_path(self.path)
with open(path, "wb") as dst:
@cowboy
cowboy / eval-is-evil.js
Last active May 12, 2020 11:56
A JavaScript "eval is evil" narrative by way of the "pass a string to setTimeout" anti-pattern...
// An object with a property and a method.
var obj = {
name: "Ben",
logName: function() {
console.log(this.name);
}
};
// And another global variable, for good measure.
var name = "Whoops";
@ijy
ijy / xhtml-to-markdown.xsl
Created July 21, 2013 14:29
XHTML to Markdown converter.
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- XHTML-to-Markdown converter by Andrew Green, Article Seven, http://www.article7.co.uk/ -->
<!-- This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. -->
<xsl:stylesheet version='1.0' xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='text' encoding='utf-8'/>
@anabelle
anabelle / mac2wep.py
Last active November 26, 2024 21:49
Script para averiguar claves de redes infinitum de 4 digitos.
#!/usr/bin/env python
#-*- encoding: utf-8 -*-
# mac2wepkey Huawei HG520 by [email protected] - 12/2010
# m2wkuvz (m2wkuvz ubuntu version) by [email protected] - 07/2012
import os, sys
def uso():
os.system("clear")
@gabrielkfr
gabrielkfr / bash-fecha-hora-actual
Created August 26, 2013 04:46
Script bash para mostrar la fecha y la hora actual.
#!/bin/bash
DIA=`date +"%d/%m/%Y"`
HORA=`date +"%H:%M"`
echo "Hoy es el $DIA y la hora actual es $HORA!"
@trey
trey / git-commit-author-rewrite.md
Last active December 18, 2024 05:46
Change the email address for a git commit.

Change the email address for a git commit.

$ git commit --amend --author="Author Name <[email protected]>"

or

$ git commit --amend --reset-author