Skip to content

Instantly share code, notes, and snippets.

View golimpio's full-sized avatar

Gilberto Olimpio golimpio

  • Beechworth VIC, Australia
  • 12:37 (UTC +10:00)
  • X @golimpio
View GitHub Profile
@didip
didip / delicious-scraper.py
Created December 17, 2010 23:53
Scrape delicious links using Python
# Requirements:
# - python-lxml
# - pyquery
#
# As implemented in http://mybucket.co
# html_util.py
from pyquery import PyQuery as pq
def extract_delicious_data_from_html(html):
results = []
@tinogomes
tinogomes / gist:749885
Created December 21, 2010 12:37
To downcase all keys and subkeys from a hash
class Hash
def downcase_all_keys
result = self.map do |k,v|
[
k.downcase,
case v.class.name
when "Hash" then v.downcase_all_keys
when "Array" then v.map {|i| i.downcase_all_keys }
else v
end
#!/bin/sh
# simple script for turning a jar with a Main-Class
# into a stand alone executable
# cat [your jar file] >> [this file]
# then chmod +x [this file]
# you can now exec [this file]
commandToRun="$(printf "%q " "$@")"
if test "$commandToRun" = "'' "; then
eval "exec java -Xmx1G -jar $0"
else
@Arthraim
Arthraim / bottle_example.py
Created May 27, 2011 04:27
a python web framework bottle's example
#coding: utf-8
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template
@route('/')
@route('/index.html')
def index():
return '<a href="/hello">Go to Hello World page</a>'
@route('/hello')
def hello():
@unhammer
unhammer / window-toggle-decorations.py
Created February 13, 2012 08:55
toggle gtk window decorations
#! /usr/bin/python2
import gtk.gdk
w = gtk.gdk.window_foreign_new( gtk.gdk.get_default_root_window().property_get("_NET_ACTIVE_WINDOW")[2][0] )
w.set_decorations( (w.get_decorations()+1)%2 ) # toggle between 0 and 1
gtk.gdk.window_process_all_updates()
gtk.gdk.flush()
# now bind this to super-r or something
@ymnk
ymnk / AES.java
Last active July 20, 2023 15:54
JSch examples
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/**
* This program will demonstrate how to use "aes128-cbc".
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
public class AES{
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 21, 2024 01:45
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active June 13, 2024 02:39
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@nschwermann
nschwermann / README.md
Created May 16, 2013 18:03
Solarized IntelliJ Theme

This tweaks the darcula IntelliJ theme to better match the solarized color scheme found here https://github.com/jkaving/intellij-colors-solarized

To enable, after installing the color scheme linked above set your theme to darcula.

Preferences -> Appearance -> Theme -> Darcula

Exit IntelliJ then add the tweaked darcula properties file to the idea.jar file with the following command

jar -ufv idea.jar com/intellij/ide/ui/laf/darcula/darcula.properties