Skip to content

Instantly share code, notes, and snippets.

View zemlanin's full-sized avatar
💭
wandering aimlessly

Anton Verinov zemlanin

💭
wandering aimlessly
View GitHub Profile
@zemlanin
zemlanin / regex.alf.nu_solution.md
Last active August 8, 2016 06:54
regex.alf.nu

Solutions for regex.alf.nu (easy mode)

  1. Warmup (207)

     foo
    
  2. Anchors (208)

     k$
    
  3. Ranges (202)

@zemlanin
zemlanin / keybase.md
Created May 9, 2014 20:51
keybase.md

Keybase proof

I hereby claim:

  • I am zemlanin on github.
  • I am zem (https://keybase.io/zem) on keybase.
  • I have a public key whose fingerprint is 69AE 19AE 14E2 31E1 E727 CD27 B3A7 3ED8 9342 526F

To claim this, I am signing this object:

@zemlanin
zemlanin / yop.sh
Created August 14, 2014 16:08
yop.sh
# send yo to your devices via Yo API
# add next line to .bashrc/.zshrc to use this script
# export YO_APP="your justyo.co app token"
# USAGE: yop [link]
__yop(){
local link=$1
local api_url="http://api.justyo.co/yoall/"
@zemlanin
zemlanin / push.sh
Created August 14, 2014 16:14
push.sh
# send message to your devices via pushover.net API
# add next two or three lines to .bashrc/.zshrc to use this script
# export PUSHOVER_APP="your pushover.net app token"
# export PUSHOVER_USER="your pushover.net user key"
# # optional:
# export PUSHOVER_DEVICE="default device"
# USAGE: push <message> [-d=<device>]
# OPTIONS:
@zemlanin
zemlanin / euler14.py
Created December 15, 2014 11:44
euler14
# extra short
M=k=L=0
while k<1e6:
n=k=k+1;l=1
while n>1:n=[n/2,3*n+1][n%2];l+=1
if l>L:M,L=k,l
print M
# short and fast
r={1:1};k=L=M=0
@zemlanin
zemlanin / echo.coffee
Created July 20, 2015 15:12
react/rxjs wrapper
_ = require 'lodash'
{addons: {cloneWithProps}} = require 'react'
echoEvent = (rxId, eventStream, eventName, ev) ->
eventStream.onNext {
ev
rxId
type: eventName
}
@zemlanin
zemlanin / diff.js
Last active December 25, 2015 13:16
// https://babeljs.io/repl/#?evaluate=true
function getDiff(that, other) {
if (that == other) { return {} }
if (_.isEmpty(other)) {
return {all: true}
}
if (_.isObject(that)) {
@zemlanin
zemlanin / castcl.js
Created February 5, 2016 14:29
castcl.js
var Client = require('castv2-client').Client;
var Application = require('castv2-client').Application;
var util = require('util');
var MyApp = function() {
Application.apply(this, arguments);
};
MyApp.APP_ID = 'D60F290C';
util.inherits(MyApp, Application);
@zemlanin
zemlanin / .babelrc
Created September 2, 2016 11:04
wallaby transform
{
"presets": ["es2015", "react"]
}
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var A = (function () {
function A(cb) {
this.cb = cb;
}
return A;