Skip to content

Instantly share code, notes, and snippets.

View wailorman's full-sized avatar

Sergey Popov wailorman

View GitHub Profile
@wailorman
wailorman / gulpfile.js
Last active November 2, 2015 23:55
JSX gulp watch + browserify + babelify + livereload
var gulp = require('gulp'),
source = require('vinyl-source-stream'),
browserify = require('browserify'),
babelify = require('babelify'),
gulpLiveReload = require('gulp-livereload');
gulp.task('scripts', function () {
//noinspection JSUnresolvedFunction
return browserify('src/main.js', {debug: true}) // browserify entry file
@wailorman
wailorman / gulpfile.js
Created November 2, 2015 22:43
JSX fast watchify by gulp
var gulp = require('gulp'),
source = require('vinyl-source-stream'),
browserify = require('browserify'),
babelify = require('babelify'),
watchify = require('watchify'),
livereload = require('gulp-livereload');
var bundlePaths = {
src: {
js: [
@wailorman
wailorman / Vagrantfile
Last active November 24, 2015 19:03
rails vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
function myParseInt(str) {
return /^\s*\d+\s*$/.test(str) ? +str : NaN;
}
@wailorman
wailorman / ibb-post-hunter.js
Created January 31, 2016 22:32
ibb-post-hunter.js
'use strict';
/*! jQuery v2.2.0 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)})
@wailorman
wailorman / owen-crc.js
Created February 17, 2016 18:04
owen crc
function owenCRC16(packet, length){
var i, j;
var crc;
crc = 0;
for (i = 0; i < length; i++)
{
var b = packet[i];
for (j = 0; j < 8; j++)
{
@wailorman
wailorman / README.md
Last active June 1, 2016 16:28
Sinon sandbox factory

How to use:

Inside your mocha's test file:

const createSinonSandbox = require('./sinon-sandbox.js');
 
describe('...', ()=> {
  
 createSinonSandbox((sandbox)=> {
 sandbox.spy(...);
<!-- тест судьи -->
-
<div class="test_judge"><button class="test_judge__start t__button t__button_status_active">Играть</button></div>
<script src="/js/test.js" defer=""></script>
-
<!-- тест танакана -->
-
<div class="test_judge tanakan"><button class="test_judge__start t__button t__button_status_active">Играть</button></div>
<script src="/js/tanakan.js" defer=""></script>
@wailorman
wailorman / file.js
Created December 3, 2017 21:55
code example
console.log('123444444444')
@wailorman
wailorman / README.md
Last active July 24, 2019 19:14
Install docker & docker-compose
wget -qO- https://gist.githubusercontent.com/wailorman/e49552b520344af40fd75b2d5df2d05a/raw/8a45ebc02d6a0a9c256667e167c3279ed2b68db8/install.sh | bash