Skip to content

Instantly share code, notes, and snippets.

View jesusdomin's full-sized avatar
🤪

Jesús Ángel Domínguez jesusdomin

🤪
View GitHub Profile
@jesusdomin
jesusdomin / gist:f7ba33609c02fa16704c
Created July 14, 2015 08:28
Utils Dates and Timestamp in Oracle
-- Como obtener offset de timezone:
select tz_offset('US/Eastern') from dual;
-- Como obtener timestamp para una determinada zona horaria:
select (SYSTIMESTAMP AT TIME ZONE tz_offset('US/Eastern')) from dual;
-- Obtener date a partir de timestamp:
select CAST((SYSTIMESTAMP AT TIME ZONE tz_offset('US/Eastern')) AS DATE) from dual;
-- Date en formato unix:
@jesusdomin
jesusdomin / gist:9a4edd526e8f57649bac
Last active March 14, 2024 16:30
Load CLOB from file and write CLOB to file sample
rem
rem 15/12/2014 - jdom
rem
rem ------------------------------------------------------------------
rem OBJECTIUS:
rem
rem Ejemplo de como leer un fichero y cargar en clob, y de como
rem escribir un clog a fichero.
rem ------------------------------------------------------------------
rem NOTES:
@jesusdomin
jesusdomin / assert.swift
Created October 3, 2014 06:36
Asserts in swift
// More Info: https://developer.apple.com/swift/blog/?id=15
func assert(condition: @autoclosure () -> Bool, _ message: String = "", file: String = __FILE__, line: Int = __LINE__) {
#if DEBUG
if !condition() {
println("assertion failed at \(file):\(line): \(message)")
abort()
}
#endif
}
@jesusdomin
jesusdomin / ItemStore.swift
Last active August 29, 2015 14:07
Singleton in Swift example
// More info: http://code.martinrue.com/posts/the-singleton-pattern-in-swift
import UIKit
class ItemStore {
class var sharedInstance: ItemStore {
struct Static {
static var instance: ItemStore?
@jesusdomin
jesusdomin / AppDelegate.swift
Last active August 29, 2015 14:06
iOS 7> Local notifications sample
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
@jesusdomin
jesusdomin / LogUtil.h
Created September 17, 2014 06:51
LogUtil
/*
* LogUtil.h
*/
// Comment for hide
#define LOG_INFO
#define LOG_ERROR
#define LOG_DEBUG
//#define LOG_FINE_DEBUG