jq is useful to slice, filter, map and transform structured json data.
brew install jq
######################################################################################################### | |
# Dependencies: rbtrace (https://github.com/tmm1/rbtrace) in the ruby process that will be analyzed # | |
# Reference: https://samsaffron.com/archive/2015/03/31/debugging-memory-leaks-in-ruby # | |
######################################################################################################### | |
require 'json' | |
class MemoryLeakAnalyzer | |
attr_reader :filename | |
def initialize |
db/schema.rb merge=railsschema |
[server] | |
SERVER | |
[server:vars] | |
server_name=SERVER | |
email=noc@gopractice.io | |
docker_nginx_ssl=true |
#!/usr/bin/env python3 | |
''' | |
Clone all repos from Bitbucket user or team | |
It assumes you have 'git' and/or 'hg' in your path | |
usage: clone_bitbucket_repos.py user --login you@example.com | |
''' | |
import argparse | |
import getpass |
require 'thread' # for Mutex: Ruby doesn't provide out of the box thread-safe arrays | |
class ThreadPool | |
def initialize(max_threads = 10) | |
@pool = SizedQueue.new(max_threads) | |
max_threads.times{ @pool << 1 } | |
@mutex = Mutex.new | |
@running_threads = [] | |
end |
function simulateDragDrop(sourceNode, destinationNode) { | |
var EVENT_TYPES = { | |
DRAG_END: 'dragend', | |
DRAG_START: 'dragstart', | |
DROP: 'drop' | |
} | |
function createCustomEvent(type) { | |
var event = document.createEvent("CustomEvent") | |
event.initCustomEvent(type, true, true, null) |
brew install ffmpeg \ | |
--with-dcadec \ | |
--with-faac \ | |
--with-fdk-aac \ | |
--with-ffplay \ | |
--with-fontconfig \ | |
--with-freetype \ | |
--with-frei0r \ | |
--with-libass \ | |
--with-libbluray \ |
<?php | |
const PASSWORD = '!!!!!sufficiently_long_password!!!!!'; | |
const CIPHER_METHOD = 'AES-256-CBC'; | |
function encrypt($str) { | |
$iv_length = openssl_cipher_iv_length(CIPHER_METHOD); | |
$iv = mcrypt_create_iv($iv_length, MCRYPT_RAND); | |
$str = $iv.$str; | |
$val = openssl_encrypt($str, CIPHER_METHOD, PASSWORD, 0, $iv); |
function simulateDragDrop(sourceNode, destinationNode) { | |
var EVENT_TYPES = { | |
DRAG_END: 'dragend', | |
DRAG_START: 'dragstart', | |
DROP: 'drop' | |
} | |
function createCustomEvent(type) { | |
var event = new CustomEvent("CustomEvent") | |
event.initCustomEvent(type, true, true, null) |