Skip to content

Instantly share code, notes, and snippets.

@iynere
iynere / Dockerfile
Last active January 28, 2021 10:12
redis 2.8.4 Dockerfile: https://hub.docker.com/r/iynere/redis
FROM redis:2.8.6
# downgrade to Redis 2.8.4
WORKDIR /usr/local/bin
# http://grainier.net/how-to-uninstall-redis-server-from-ubuntu
RUN rm -r redis-benchmark redis-check-aof redis-check-dump redis-cli redis-sentinel redis-server
WORKDIR /
FROM ubuntu:14.04
USER root
# set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
# use unicode
RUN locale-gen C.UTF-8 || true
ENV LANG=C.UTF-8
@iynere
iynere / README.md
Last active May 11, 2017 09:00
cryptoSquare

Crypto Square

Slides

Difficulty: Medium

Cohort Date
Jan-15 2014-04-06

@iynere
iynere / phoneWords.js
Last active May 11, 2017 15:39
string permutation problem, tree implementation solution
// given the traditional correspondences between numbers & letters on a telephone, as follows:
const phone = {
'2': 'ABC',
'3': 'DEF',
'4': 'GHI',
'5': 'JKL',
'6': 'MNO',
'7': 'PQRS',
'8': 'TUV',
@iynere
iynere / ccm_fl.js
Last active April 25, 2017 00:55
slight edits to http://moonconnection.com/moon_module.phtml js to force https, so chrome doesn't complain (ex: https://isar0se.github.io/moon-module-ex)
/* if you're trying to embed this on your blog or website:
0. generate yr embed code as usual from https://moonconnection.com/moon_module.phtml
- replace the js file path with this one
1. use https://rawgit.com to spoof headers
- full url for this file is https://cdn.rawgit.com/isar0se/0c9c6580ee5097389a16aaa00e8c7673/raw/35dea55bce3955524d29d2024d7b6a06b4e32ce0/ccm_fl.js
- if you try to past the raw file url in directly, the content type will be 'plain text' not 'javascript' or w/e
2. chrome disables flash autoplay by default & there's no way to un-disable it
- the moon embed is annoying if there's a play button
- but if you bump the embed width* to something like 700 at least (not sure the exact cutoff), chrome assumes it's content & not advertising & allows autoplay
- autoplay is enabled via the '&autoPlay=true' param in the FlashVars string
@iynere
iynere / bipartite-2-color-recursive.js
Created April 19, 2017 08:51
recursive two-color / bipartite graph solution
/* TWO-COLOR PROBLEM,
i.e., whether or not a given undirected, connected graph is bipartite:
https://en.wikipedia.org/wiki/Bipartite_graph */
/* complexity [of non-recursive Fullstack Academy solution] ? O(n*n) i believe, O(n*n+n) technically */
/* can we do better ? definitely */
/* given a graph */
let zero = {num: 0},