Skip to content

Instantly share code, notes, and snippets.

View dsignr's full-sized avatar

Neya dsignr

View GitHub Profile
@dsignr
dsignr / The Technical Interview Cheat Sheet.md
Last active June 1, 2017 18:11 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
  • They are one of the oldest, most commonly used data structures.

Deploying Elixir and Phoenix applications using Docker and Exrm

Goal

By the end of this quick guide, you will know how to compile a Phoenix app release using Exrm and run it inside a Docker container. I've found only a couple of articles that discuss getting an Elixir app up and running inside a Docker container, and even those only touched on some parts of the process. The idea is that this guide will give you a full end-to-end example of how to get all the pieces and parts working together so that you are able to deploy your Phoenix application inside a Docker container.

Assumptions

  1. You already have a working Elixir environment with the Phoenix Framework installed
  2. You have at least basic working knowledge of Docker, and have installed the Docker tools onto your local environment
@dsignr
dsignr / recover_source_code.md
Created March 12, 2017 07:28 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@dsignr
dsignr / simple_split_test.js
Created January 13, 2017 02:58
Simple split test
var siteEvent;
var siteSplit;
jQuery(function() {
siteEvent = function(c, a, l, v) {
dataLayer.push({
'event': 'siteEvent',
'siteEventCategory': c,
'siteEventAction': a,
'siteEventLabel': l,
'siteEventValue': v
@dsignr
dsignr / Poll.js
Last active September 15, 2016 05:23
Poll for jQuery until it is loaded
// Source: http://stackoverflow.com/a/17914854/381150
// Sometimes you don't have control over a web page and you need to inject some scripts which are dependent on jQuery.
// However, this will throw a jQuery/$ undefined error and so the only solution is to poll until it's available.
function defer(method) {
if (window.jQuery)
method();
else
setTimeout(function() { defer(method) }, 50);
}
@dsignr
dsignr / gist:78617a6b0a7a096345a0832f4ba4b5ce
Created August 13, 2016 05:36 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@dsignr
dsignr / datauri-generator.js
Created August 11, 2016 03:48 — forked from psema4/datauri-generator.js
Generate Data URI's on the fly
// SOURCE: http://davidwalsh.name/convert-image-data-uri-javascript
function getDataUri(url, callback) {
var image = new Image();
image.onload = function () {
var canvas = document.createElement('canvas');
canvas.width = this.naturalWidth; // or 'width' if you want a special/scaled size
canvas.height = this.naturalHeight; // or 'height' if you want a special/scaled size
@dsignr
dsignr / Managing Oauth tokens.md
Created August 4, 2016 07:06
R reference for .httr-auth
# Deploying NodeJS App on Google Cloud Platform
`authored Jul 3 2015 by kengz`
## Installation
- Account with Google Cloud Platform.
- Install [Google Cloud Platform SDK](https://cloud.google.com/sdk/) to use `cloud` in the terminal.
- Install [Docker](https://cloud.google.com/tutorials/install-docker) for the VM container.
- Locally, login for the first time: `gcloud auth login`
@dsignr
dsignr / How to install packages in google datalab.py
Created July 8, 2016 02:00
A short snippet to help you install packages on a google datalab install
# How to install packages:
# %%bash
# pip install <package>