Skip to content

Instantly share code, notes, and snippets.

View knxroot's full-sized avatar

Gustavo Lacoste knxroot

View GitHub Profile
@kimus
kimus / cx_oracle.md
Last active April 28, 2024 10:54
Installing python cx_oracle on Ubuntu

First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.

Linux

Step 1:

sudo apt-get install build-essential unzip python-dev libaio-dev

Step 2. Click here to download the appropriate zip files required for this. You'll need:

@FloorLamp
FloorLamp / foursquare_extract.py
Created January 5, 2014 20:21
Foursquare data extraction
from collections import defaultdict
import datetime
import requests
import time
CHECKINS_API = 'https://api.foursquare.com/v2/users/self/checkins'
CATEGORIES_API = 'https://api.foursquare.com/v2/venues/categories'
YEAR_BEGIN = int(time.mktime(datetime.date(2013,1,1).timetuple()))
YEAR_END = int(time.mktime(datetime.date(2014,1,1).timetuple()))
WEEK = int(time.mktime(datetime.date(2013,12,29).timetuple()))
@tmplinshi
tmplinshi / KeypressOSD.ahk
Last active February 16, 2024 12:55
Note: This script has been moved to https://github.com/tmplinshi/KeypressOSD
; KeypressOSD.ahk
;--------------------------------------------------------------------------------------------------------------------------
; ChangeLog : v2.22 (2017-02-25) - Now pressing same combination keys continuously more than 2 times,
; for example press Ctrl+V 3 times, will displayed as "Ctrl + v (3)"
; v2.21 (2017-02-24) - Fixed LWin/RWin not poping up start menu
; v2.20 (2017-02-24) - Added displaying continuous-pressed combination keys.
; e.g.: With CTRL key held down, pressing K and U continuously will shown as "Ctrl + k, u"
; v2.10 (2017-01-22) - Added ShowStickyModKeyCount option
; v2.09 (2017-01-22) - Added ShowModifierKeyCount option
; v2.08 (2017-01-19) - Fixed a bug
@zeroSteiner
zeroSteiner / odbc_trace_parser.py
Last active July 26, 2016 16:45
Parse ODBC Trace logs into a more easily usable format.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# odbc_trace_parser.py
#
# Copyright 2013 Spencer McIntyre <zeroSteiner@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@johnkary
johnkary / OracleDoctrineTypeMappingListener.php
Created September 8, 2013 03:45
Connecting to Oracle with Symfony2 and Doctrine 2. 1. Map Oracle's DATE type to Doctrine's "date" type instead of "datetime" for Oracle driver. 2. Properly configures Doctrine to use most common Oracle Date and DateTime environment configurations. You may or may not need this. Check your Oracle server configuration and see \Doctrine\DBAL\Event\L…
<?php
namespace Acme\PeopleSoftBundle\Listener;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
use Doctrine\Common\EventSubscriber;
/**
* Changes Doctrine's default Oracle-specific column type mapping to Doctrine
@shawndumas
shawndumas / .gitconfig
Created August 5, 2013 19:08
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@JamoCA
JamoCA / ColumnToSQLList.ahk
Created July 26, 2013 15:30
AutoHotKey script to convert clipboard columnar data (from Excel or text file) to SQL-compatible comma-delimited list (adds single quotes if data consists of non-numeric values) (Windows+C)
#c:: ;Window+C Convert Columnar Data to SQL-Compatible List
StringReplace,clipboard,clipboard,`n,`,,All
StringReplace,clipboard,clipboard,`r,,All
StringGetPos, pos, clipboard, ID`, ; remove "ID" if first item in the list (Access).
if pos = 0
StringRight, clipboard, clipboard, StrLen(clipboard)-3
testString = %clipboard%
StringReplace,testString,testString,`,,,All
testString := testString * 1
if (testString is integer) {
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active April 17, 2024 10:51
Backend Architectures Keywords and References
@ryane
ryane / ci_install.sh
Created April 17, 2013 19:38
A script (or just list of commands) to setup a jenkins server on Ubuntu 12.04 hosted at linode. Liberally borrowed from https://gist.github.com/whistler/3179919#file-jenkins_rails_ubuntu-sh
sudo aptitude -y install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev
sudo apt-get -y install libxslt-dev libxml2-dev
sudo apt-get -y install libmysqlclient-dev ruby-dev
sudo apt-get -y install libcurl4-openssl-dev
sudo apt-get -y install imagemagick libmagickcore-dev libmagickwand-dev
sudo apt-get -y install libsqlite3-dev
sudo apt-get -y install libreadline-dev
sudo apt-get -y install git
sudo apt-get -y install libicu48
sudo apt-get -y install nodejs
@bradmontgomery
bradmontgomery / geo.py
Created April 16, 2013 16:42
Example of Reverse Geocoding in python with Google Maps api
import requests
def example():
# grab some lat/long coords from wherever. For this example,
# I just opened a javascript console in the browser and ran:
#
# navigator.geolocation.getCurrentPosition(function(p) {
# console.log(p);
# })