Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View haxpor's full-sized avatar
🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller

Wasin Thonkaew haxpor

🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller
View GitHub Profile
@keith
keith / link.sh
Last active December 22, 2016 13:35
Build to iOS 10 from Xcode 7.3.1
@jackc
jackc / results.txt
Created July 21, 2017 20:45
github.com/jackc/go_db_bench results
$ PGHOST=/var/run/postgresql go test -bench . -benchmem
BenchmarkPgxNativeSelectSingleShortString-8 100000 17873 ns/op 292 B/op 6 allocs/op
BenchmarkPgxStdlibSelectSingleShortString-8 100000 20602 ns/op 907 B/op 24 allocs/op
BenchmarkPgSelectSingleShortString-8 100000 17451 ns/op 120 B/op 8 allocs/op
BenchmarkPqSelectSingleShortString-8 100000 22604 ns/op 832 B/op 25 allocs/op
BenchmarkRawSelectSingleShortValue-8 100000 15735 ns/op 6 B/op 0 allocs/op
BenchmarkPgxNativeSelectSingleShortBytes-8 100000 17808 ns/op 314 B/op 7 allocs/op
BenchmarkPgxStdlibSelectSingleShortBytes-8 100000 20891 ns/op 933 B/op 25 allocs/op
BenchmarkPqSelectSingleShortBytes-8 50000 22005 ns/op 856 B/op 26 allocs/op
BenchmarkPgxNativeSelectSingleRow-8 100000 21577 ns/op 478 B/
@Falconerd
Falconerd / gulpfile.js
Last active April 10, 2019 17:16
Gulp + Watchify + Babelify + BrowserSync
/**
* This gulpfile will copy static libraries and a index.html file as well as
* merge, babelify and uglify the rest of the javascript project.
*
* TODO:
* - Separate media, libs and src with different watchers.
* - Media and libs should only be copied to dist if they are different sizes.
*
* The expected project is to be laid out as such:
*
(function($, window, undefined) {
var InfiniteScroll = function() {
this.initialize = function() {
this.setupEvents();
};
this.setupEvents = function() {
$(window).on(
'scroll',
this.handleScroll.bind(this)
@daliborgogic
daliborgogic / delay.js
Created December 16, 2016 15:26
Node.js Async/Await delay
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
}
async function delay () {
@matsuda
matsuda / NSData+AES.h
Created February 25, 2014 07:14
Objective-C code for encrypt and decrypt by AES-128 encryption.
/**
http://mythosil.hatenablog.com/entry/20111017/1318873155
http://blog.dealforest.net/2012/03/ios-android-per-aes-crypt-connection/
*/
@interface NSData (AES)
- (NSData *)AES128EncryptedDataWithKey:(NSString *)key;
- (NSData *)AES128DecryptedDataWithKey:(NSString *)key;
- (NSData *)AES128EncryptedDataWithKey:(NSString *)key iv:(NSString *)iv;
@antiagainst
antiagainst / function-argument.cmake
Created December 28, 2014 16:00
ARGC, ARGV, ARGN, ARGVn in CMake
cmake_minimum_required(VERSION 2.8)
function(use_llvm TARGET)
message("ARGC=\"${ARGC}\"")
message("ARGN=\"${ARGN}\"")
message("ARGV=\"${ARGV}\"")
message("ARGV0=\"${ARGV0}\"")
message("ARGV1=\"${ARGV1}\"")
endfunction()
@subfuzion
subfuzion / mongo-autostart-osx.md
Last active March 2, 2022 00:57
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

```
// This code snippet shows how an external function can use a pattern like
// python's `try..except..else` with `.call`, `throw`, and reentry
contract TryExceptElsePatternUser {
address _sender;
function tryExceptElsePatternExample()
external // must be external
{
if( msg.sender == address(this) ) {
@digital-wonderland
digital-wonderland / README.md
Last active April 6, 2022 17:22
Unit files to deploy an ElasticSearch cluster on CoreOS via Fleet