Skip to content

Instantly share code, notes, and snippets.

View hackvan's full-sized avatar

Diego Camacho hackvan

View GitHub Profile
@lucolivier-dumaisblais
lucolivier-dumaisblais / OOP.pls
Created April 1, 2011 02:11
Example of Object-oriented programming in PL/SQL
DROP TYPE Student;
DROP TYPE Person;
CREATE OR REPLACE TYPE Person As Object (
firstName VARCHAR2(30),
lastName VARCHAR2(30),
phoneNumber CHAR(10)
) NOT FINAL;
/
CREATE OR REPLACE TYPE Student UNDER Person (
@tsabat
tsabat / zsh.md
Last active January 3, 2026 06:27
Getting oh-my-zsh to work in Ubuntu
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@daicham
daicham / gist:4109527
Created November 19, 2012 08:08
A sample ruby code of executing SQL for Oracle
# encoding: utf-8
#
# Prerequisite:
# gem install ruby-oci8
require 'oci8'
def log(message)
puts "#{Time.now.strftime("%Y-%m-%d %H:%M:%S")} #{message}"
end
@toronya
toronya / oracle_to_csv.rb
Last active December 29, 2015 22:20
simple example of DB table to csv (oracle)
# coding:utf-8
# usage: ruby oracle_to_csv.rb > sample.csv
require 'rubygems'
require 'oci8' # before you need install : gem install ruby-oci8
def csvout(user, pass, world, sql)
begin
ora = OCI8.new(user,pass,world)
c = ora.exec(sql)
@ppdeassis
ppdeassis / oracle_reader.rb
Created June 18, 2013 14:35
A Ruby class to acces an Oracle database
################################################################################
require 'oci8'
require 'iconv'
################################################################################
class OracleReader
################################################################################
def initialize(server, username, password)
# Open the connection.
@connection = OCI8.new(username, password, server)
@dwayne
dwayne / ch1.md
Last active December 2, 2024 19:32
My notes from the book "Eloquent Ruby by Russ Olsen"

Chapter 1

Every programming community quickly converges on a style, an accepted set of idioms. Programming is all about communication and knowing those idioms are key to being a successful programmer in that community.

Ruby style of programming:

  • Code should be crystal clear, it should shout its intent
  • Good code is also concise

Ruby indentation convention:

# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
@Kartones
Kartones / postgres-cheatsheet.md
Last active February 6, 2026 08:00
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@umidjons
umidjons / parse-json-in-plsql.md
Created August 1, 2014 04:25
Parse JSON in PL/SQL

Parse JSON in PL/SQL

Download and install PL/JSON.

Following is an example of how to parse a JSON array represented as string:

declare
	my_clob clob := '[