Difficulty: Medium
Cohort | Date |
---|---|
Jan-15 | 2014-04-06 |
/* 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}, |
/* 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 |
// 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', |
Difficulty: Medium
Cohort | Date |
---|---|
Jan-15 | 2014-04-06 |
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 |
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 circleci/ruby:2.4.1-node-browsers | |
USER root | |
# pulling in commands from 'install os packages' | |
RUN sudo apt-get update | |
RUN sudo apt-get install -y qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x postgresql-client | |
# install elasticsearch | |
RUN wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.2.tar.gz |
FROM circleci/ruby:2.3.4-node | |
# pulling in commands from 'install os packages' | |
RUN sudo apt-get update | |
RUN sudo apt-get -qq install -y xvfb graphicsmagick |
FROM circleci/ruby:2.3-node | |
# downgrade to Node v6.8.0 | |
RUN sudo npm cache clean -f | |
RUN sudo npm install -g n | |
RUN sudo n 6.8.0 |
FROM mdillon/postgis:9.4 | |
ENV POSTGRES_USER=root \ | |
POSTGRES_DB=circle_test | |
# This is performance optimization tweak to make DB faster | |
RUN if [ -e /usr/local/share/postgresql/postgresql.conf.sample ]; then \ | |
postgresfile=/usr/local/share/postgresql/postgresql.conf.sample; \ | |
else \ | |
postgresfile=/usr/share/postgresql/postgresql.conf.sample; \ |