Skip to content

Instantly share code, notes, and snippets.

View yefim's full-sized avatar

Yefim Vedernikoff yefim

View GitHub Profile
@yefim
yefim / Stylefile.yml
Created July 27, 2018 06:22
Customizations for yef.im via StyleURL.
---
version: 1.0
domains:
- yef.im
url_patterns:
- yef.im/*
timestamp: '2018-07-27T06:22:31Z'
id: _miH
redirect_url: https://yef.im/
shared_via: StyleURL – import and export CSS changes from Chrome Inspector to a Gist
@yefim
yefim / Stylefile.yml
Created July 27, 2018 06:12 — forked from Jarred-Sumner/Stylefile.yml
Customizations for yef.im via StyleURL.
---
version: 1.0
domains:
- yef.im
url_patterns:
- yef.im/*
timestamp: '2018-07-27T04:42:45Z'
id: 1hhU
redirect_url: https://yef.im/
shared_via: StyleURL – import and export CSS changes from Chrome Inspector to a Gist
Verifying my Blockstack ID is secured with the address 1Bo7ejqkATP6BUcv7WauFQdx4BUQBrLoX9 https://explorer.blockstack.org/address/1Bo7ejqkATP6BUcv7WauFQdx4BUQBrLoX9
@yefim
yefim / benchmarking
Created January 23, 2017 22:38
Benchmark built in Mongoid hooks against just calling functions normally.
irb> def benchmark
irb> s = Time.zone.now
irb> 50000.times { yield }
irb> e = Time.zone.now
irb> e - s
irb> end
=> :benchmark
irb> benchmark do
irb> u = RollingUser.new
irb> u.save
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
<!DOCTYPE html>
<html>
<head>
<style>
div {
display: none;
}
.active {
display: block;
@yefim
yefim / editDistance.js
Last active April 26, 2019 23:53
Levenshtein distance implementation in JavaScript
const editDistance = (a, b) => {
if (a === '' || b === '') {
return Math.max(a.length, b.length);
}
return (a[0] === b[0] ? 0 : 1) + Math.min(
editDistance(a.substring(1), b.substring(1)),
editDistance(a.substring(1), b),
editDistance(a, b.substring(1))
);
@yefim
yefim / format.vim
Last active October 26, 2016 01:15
Reindent and retab any and all files from the command line
gg=G
:retab
ZZ
@yefim
yefim / bind.js
Created April 26, 2015 17:41
Using bind to set parameters
var Item = React.createClass({
render: function() {
return (
<div onClick={this.props.handleClick.bind(this, this.props.item)}>{this.props.item}</div>;
);
}
})
var List = React.createClass({
handleClick: function(item) {
@yefim
yefim / web.js
Created July 23, 2014 01:03
500 as a Service
var express = require("express");
var logfmt = require("logfmt");
var app = express();
app.use(logfmt.requestLogger());
app.get('/', function(req, res) {
res.send(500);
});