Skip to content

Instantly share code, notes, and snippets.

View yefim's full-sized avatar

Yefim Vedernikoff yefim

View GitHub Profile
@yefim
yefim / gglto.rb
Created May 20, 2013 07:26
ggl.to in 3 lines of ruby
require 'sinatra'
get("/") { "this is an even simpler version of ggl.to" }
get("/:q") { |q| redirect "https://google.com/search?q=#{q}" }
@yefim
yefim / gist:6753039
Last active December 24, 2015 05:49
Snapchan
The Snapchat-only image board
* Send a snap to `rsnapchat`
* [Subscribe, discuss, enjoy!](http://reddit.com/r/snapchan)
Hacked together by [@yefim](http://twitter.com/yefim) and [@russjf](https://twitter.com/russjf)
@yefim
yefim / isBST.cpp
Last active December 25, 2015 15:29
Check whether a binary tree is a BST
struct Node {
int value;
Node* left;
Node* right;
};
bool isBSTUtil(const Node* node, int min, int max) {
return (node == NULL) ||
(node->value < max && node->value > min) &&
isBSTUtil(node->left, min, node->value) &&
import requests
import time
import pprint
import hashlib
# import rijndael
from Crypto.Cipher import AES
DEFAULT_OPTIONS = {
'blob_enc_key': 'M02cnQ51Ji97vwT4',
'debug': False,
@yefim
yefim / app.coffee
Last active October 4, 2016 07:19
A simple opt in group messaging solution with Twilio, Redis, and Expressjs
NUMBERS_SET = 'numbers'
TWILIO_NUMBER = '+12345678900'
TWILIO_SID = 'account_sid'
TWILIO_TOKEN = 'auth_token'
express = require('express')
http = require('http')
path = require('path')
redis = require('redis')
app = express()

How I built a Her-inspired hack in 24 hours

On January 24th of this year I had the fortune of attending hackTECH in Santa Monica, CA. Having been raised in LA, I thought it would be the perfect opportunity to invite my little brother Sam and his friend Matthew to come hack with me. I had been to 22 hackathons at that point and considered myself to be a hackathon veteran.

Sam, Matthew, and I arrived to hackTECH late Friday afternoon and started brainstorming ideas. We walked by a few of the sponsor tables to get an idea for some of the API prizes that were being offered. Lob and Microsoft caught my eye and I pitched them the idea of a Windows Phone app that lets you dictate and send postcards to your friends. I had just seen the movie Her earlier that week and was inspired by the main protagonist's job in the movie. For those who haven't seen it, Theodore is basically a love guru who writes heartfelt letters for strangers

@yefim
yefim / app.js
Created April 9, 2014 23:51
Mongodb native driver and Expressjs intergration
var express = require('express');
var app = express();
var MongoClient = require('mongodb').MongoClient;
MongoClient.connect('mongodb://127.0.0.1:27017/test', function(err, db) {
var collection = db.collection('collection');
app.get('/', function(req, res) {
collection.find().toArray(function(err, results) {
res.json(results);
@yefim
yefim / venmo.py
Last active August 29, 2018 20:24
Hit venmo public feed API to see what the most liked venmo was
import requests
def hit_api():
page = "https://venmo.com/api/v5/public"
venmos = []
counter = 0
while (counter < 50):
r = requests.get(page)
page = r.json["paging"]["next"]
@yefim
yefim / venmo.py
Last active August 29, 2015 14:03
Venmo transaction total
from requests import get
url = "https://venmo.com/api/v5/users/<YOUR_USER_ID>/feed?access_token=<YOUR_ACCESS_TOKEN>"
transactions = []
while url:
data = get(url).json()
url = data.get('paging', {}).get('next', None)
for d in data.get('data', []):
transactions += d.get('transactions', [])
@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);
});