Skip to content

Instantly share code, notes, and snippets.

View uniibu's full-sized avatar
🏠
Don't comment bad code - rewrite it

Uni Sayo uniibu

🏠
Don't comment bad code - rewrite it
View GitHub Profile
@uniibu
uniibu / lebab.min.js
Created July 31, 2017 17:41
Umdfied build of lebab
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.lebab=e()}}(function(){var e;return function e(t,n,r){function i(o,a){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return i(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){function r(e,t){return h.isUndefined(t)?""+t:h.isNumber(t)&&!isFinite(t)?t.toString():h.isFunction(t)||h.isRegExp(t)?t.toString():t}function i(e,t){return h.isString(e)?e.length<t?e:e.slice(0,t):e}function s(e){return i(JSON.stringify(e.actual,r),128)+" "+e.operator
test
@uniibu
uniibu / zeromq-install.sh
Created June 10, 2017 01:50
Install zeromq extenstion for plesk 12/onyx with php 7.0
#!/bin/bash
apt-get update
apt-get install libzmq3-dev plesk-php70-dev libtool pkg-config build-essential autoconf automake
cd /tmp
wget -O zeromq4.tar.gz https://github.com/zeromq/libzmq/releases/download/v4.2.1/zeromq-4.2.1.tar.gz
tar -xf zeromq4.tar.gz
cd zeromq4
./configure
make
sudo make install
@uniibu
uniibu / async-examples.js
Created May 25, 2017 11:25 — forked from developit/async-examples.js
Async Array utilities in async/await. Now available as an npm package: https://github.com/developit/asyncro
/** Async version of Array.prototype.reduce()
* await reduce(['/foo', '/bar', '/baz'], async (acc, v) => {
* acc[v] = await (await fetch(v)).json();
* return acc;
* }, {});
*/
export async function reduce(arr, fn, val, pure) {
for (let i=0; i<arr.length; i++) {
let v = await fn(val, arr[i], i, arr);
if (pure!==false) val = v;
<?php
/* This file is hereby released to public domain */
require_once(__DIR__ . '/../lib/jsonRPCClient_bitcoin.php');
global $CONFIG;
$CONFIG = array(
'bitcoind_user' => 'change_this',
'bitcoind_pass' => 'change_this',
'bitcoind_port' => 'change_this',
'bitcoind_fee' => 0.0002, // Shoudl be enough for anybody
@uniibu
uniibu / stripmarks.js
Created June 15, 2016 16:32
strip abnormal marks
/*! https://mths.be/stripcombiningmarks v0.1.0 by @mathias */
;(function(root) {
// Detect free variables `exports`
var freeExports = typeof exports == 'object' && exports;
// Detect free variable `module`
var freeModule = typeof module == 'object' && module &&
module.exports == freeExports && module;
@uniibu
uniibu / escapeHTML.js
Last active June 15, 2016 16:33
escapinghtml
function escapeHTML(str){
str = str + "";
var out = "";
for(var i=0; i<str.length; i++){
if(str[i] === '<') {
out += '&lt;';
} else if(str[i] === '>'){
out += '&gt;';
} else if(str[i] === "'"){
out += '&#39;';
@uniibu
uniibu / rubies-ubuntu.sh
Created May 22, 2016 17:49
Compilation of dependencies and full rubies coin installation on ubuntu 14.04
sudo apt-add-repository ppa:bitcoin/bitcoin -y && sudo apt-get update && sudo mkdir -v rubies && cd rubies && sudo wget https://github.com/uniibu/rubies-core-dev/archive/1.2.0.3-patch.tar.gz && sudo tar -xzvf 1.2.0.3.tar.gz && sudo apt-get install build-essential libdb4.8++-dev libtool libssl-dev libboost-all-dev libminiupnpc-dev -y && cd rubies-core-1.2.0.3/src && sudo make -f makefile.unix