Skip to content

Instantly share code, notes, and snippets.

View moltar's full-sized avatar
📦
Building stuff.

Roman moltar

📦
Building stuff.
View GitHub Profile
@moltar
moltar / bull.js
Created June 20, 2018 15:52
Assure bull only runs a single instance of a job
global.Promise = require('bluebird')
const Queue = require('bull')
const EventEmitter = require('events')
const JOB_NAME = 'testJob'
const PROGRESS_BUS_EVENT_NAME = 'progress'
const COMPLETED_PROGRESS_VALUE = 100
const { log } = console
@moltar
moltar / bootstrapVue.js
Created April 14, 2018 20:51
vue bootstrap
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved */
import Vue from 'vue'
import {
Layout, Modal, Button, FormGroup, FormInput,
FormTextarea, InputGroup, Jumbotron, Collapse, Card,
Tabs, Popover, Badge
} from 'bootstrap-vue/es/components'
Vue.use(Layout)
@moltar
moltar / 01_order.svg
Last active March 28, 2018 19:11
demo svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moltar
moltar / shortid.js
Created March 20, 2018 22:28
duid conflict
const duid = require('short-duid')
const inst = duid.init({
shardId: 1,
salt: 'foo',
epochStart: 1517363935892
})
for (let i = 0; i < 100000; i += 1) {
const ids = inst.getDUIDInt(1)
@moltar
moltar / PayKickStart.js
Created September 11, 2017 16:01
PayKickStart IPN POST Checksum Verification in JavaScript
function verifyChecksum (params, secret) {
const valuesArray = Object
.keys(params)
.filter((key) => key && params[key] && key !== 'verification_code')
.map((key) => params[key])
const valuesObject = {}
for (let i = 0; i < valuesArray.length; i++) {
// stringify indexes for ASCII sort
valuesObject[i.toString()] = valuesArray[i]
@moltar
moltar / test2.html
Created October 17, 2015 22:42
test2
asdasd
new trhing
update gist
asdasd
new line
@moltar
moltar / -
Created September 20, 2014 13:58
Undefined symbols for architecture x86_64:
"cv::fastMalloc(unsigned long)", referenced from:
cv::Ptr<cv::flann::SearchParams>::Ptr(cv::flann::SearchParams*) in FindTheGhost-306b62.o
cv::Ptr<cv::flann::IndexParams>::Ptr(cv::flann::IndexParams*) in FindTheGhost-306b62.o
"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
_main in FindTheGhost-306b62.o
"cv::drawMatches(cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocator<cv::KeyPoint> > const&, cv::Mat const&, std::__1::vector<cv::KeyPoint, std::__1::allocator<cv::KeyPoint> > const&, std::__1::vector<cv::DMatch, std::__1::allocator<cv::DMatch> > const&, cv::Mat&, cv::Scalar_<double> const&, cv::Scalar_<double> const&, std::__1::vector<char, std::__1::allocator<char> > const&, int)", referenced from:
_main in FindTheGhost-306b62.o
"cv::_OutputArray::_OutputArray(cv::Mat&)", referenced from:
_main in FindTheGhost-306b62.o
@moltar
moltar / rc
Created December 26, 2013 19:01
Make cpanm cache tar balls locally. Put this line in your .bashrc or .zshrc file.
export PERL_CPANM_OPT="--cascade-search --save-dists=$HOME/.cpanm/cache --mirror=$HOME/.cpanm/cache --mirror=http://search.cpan.org/CPAN"
@moltar
moltar / file.pl
Created November 10, 2013 13:57
__FILE__
package A;
sub file {
__FILE__;
}
package B;
use base 'A';
@moltar
moltar / out.txt
Created March 27, 2013 21:21
carton exec issue
# WORKS
perl -Ilocal bin/daemons/gearman-worker.pl start -f
# DOES NOT WORK
carton exec "bin/daemons/gearman-worker.pl start -f"
dyld: lazy symbol binding failed: Symbol not found: _gearman_worker_create
Referenced from: local/lib/perl5/darwin-2level/auto/Gearman/XS/XS.bundle
Expected in: dynamic lookup