This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Querying your ledger through Kraken's API only return 50 results... */ | |
var KrakenClient = require('kraken-api'); // https://github.com/nothingisdead/npm-kraken-api | |
var kraken = new KrakenClient('api_key', 'api_secret'); | |
var ledger = []; | |
var offset = 0; | |
function getLedgerEntries (error, data) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Thanks to http://www.labs.saachitech.com/2012/10/23/pdf-generation-using-uiprintpagerenderer | |
// Note: including images in the HTML won't work, see here: | |
// https://github.com/nyg/HTMLWithImagesToPDF | |
import UIKit | |
// 1. Create a print formatter | |
let html = "<b>Hello <i>World!</i></b>" | |
let fmt = UIMarkupTextPrintFormatter(markupText: html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
-- ORA-02292: integrity constraint (OWNER.FK) violated - child record found | |
ora_02292 EXCEPTION; | |
PRAGMA EXCEPTION_INIT(ora_02292, -2292); | |
l_foreign_key VARCHAR2(400); | |
PROCEDURE delete_row(pi_table IN VARCHAR2, | |
pi_column IN VARCHAR2, | |
pi_value IN VARCHAR2) IS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
g_level INTEGER := 0; | |
g_owner VARCHAR2(10) := 'owner'; | |
PROCEDURE find_fk(pi_table IN VARCHAR2, | |
pi_where IN VARCHAR2) IS | |
l_where VARCHAR2(500); | |
l_pad VARCHAR2(100); | |
BEGIN | |
g_level := g_level + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filename = $argv[1]; | |
$growthFactor = $argv[2]; | |
list($width_orig, $height_orig) = getimagesize($filename); | |
$width = $width_orig * $growthFactor; | |
$height = $height_orig * $growthFactor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class Cell { | |
var name: String | |
init(_ name: String) { | |
self.name = name | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/a/45014628/5536516 | |
extension UIApplicationDelegate { | |
static var shared: Self { | |
return UIApplication.shared.delegate! as! Self | |
} | |
} | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/a/45068046/5536516 | |
import Foundation | |
func kernelBootTime() -> timeval { | |
var mib = [ CTL_KERN, KERN_BOOTTIME ] | |
var bootTime = timeval() | |
var bootTimeSize = MemoryLayout<timeval>.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Using YQL to get JSON from an external URL</title> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<pre id='json'></pre> | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tested on macOS 10.12. | |
// | |
// Usage: | |
// $ clang uptime.c && ./a.out | |
// boot time (UNIX time): 1502299682.147510 | |
// uptime (seconds): 410563.269028116 | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> |
OlderNewer