Skip to content

Instantly share code, notes, and snippets.

@kingkorf
kingkorf / sha1.py
Created December 13, 2012 14:30
Python SHA1 generator
#!/usr/bin/env python
from getpass import getpass
from hashlib import sha1
password = getpass('Enter password: ')
repeat = getpass('Repeat password: ')
if (password != repeat):
print "Passwords do not match!"
@kingkorf
kingkorf / sha1.py
Created December 14, 2012 08:08
Python 3 SHA1 generator
#!/usr/bin/env python3
from getpass import getpass
from hashlib import sha1
password = getpass('Enter password: ')
repeat = getpass('Repeat password: ')
if (password != repeat):
print("Passwords do not match!")
@kingkorf
kingkorf / sha1.rb
Created December 14, 2012 16:16
Ruby SHA1 generator
#!/usr/bin/env ruby
require 'rubygems'
require 'highline/import'
require 'digest/sha1'
password = ask("Password: ") { |q| q.echo = false }
repeat = ask("Repeat: ") { |q| q.echo = false }
if password != repeat
@kingkorf
kingkorf / webfont.py
Created December 19, 2012 15:09
Google Web-font downloader
#!/usr/bin/env python
import argparse
import urllib2
import sys
import re
parser = argparse.ArgumentParser(description='Download Google Web-fonts')
parser.add_argument('--url', dest='url', help='URL from Google Web-fonts')
@kingkorf
kingkorf / responsiveInput.js
Last active December 15, 2015 09:19
Responsive input jQuery plugin
(function($) {
$.fn.responsiveInput = function() {
var $this = this;
$(window).resize(function() {
resizeInput($this);
});
var resizeInput = function($this) {
var def = 100;
<?php
/* Alle feestdagen kunnen berekend worden, de berekende zijn allemaal
* afhankelijk van pasen. PHP heeft een functie easter_date().
* Makkie dus. Hoe easter_date() zelf werkt kan je hier raadplegen:
* http://svn.php.net/viewvc/php/php-src/trunk/ext/calendar/easter.c?view=markup
*/
$jaar = 2012;
// vaste dagen
@kingkorf
kingkorf / Feestdagen.php
Last active December 17, 2015 13:39
Nederlandse feestdagen
<?php
trait Feestdagen
{
private function isFeestdag(\DateTime $date)
{
$feestdagen = $this->getFeestdagen($date->format('Y'));
if (in_array($date, $feestdagen)) {
return true;
}
<?php
require './web_app.php';
// sample resource
class MyObject {
public function methodName() {
echo "d!";
}
}