Skip to content

Instantly share code, notes, and snippets.

FROM ruby:2.6.5-stretch as base
RUN apt-get update && apt-get install -y \
git \
build-essential \
g++ \
libpq-dev \
qt4-dev-tools \
libqt4-dev \
nodejs
1. Pick a laptop and a USB (I think USB 2 is good)
2. Restore a backup version from USB. I do this to erase all the student's data
1. Restart the computer and press Command (⌘) – R while it's starting
3. Select Restore from Time Machine Backup from the list of available options.
4. Click Continue.
5. Click Continue on the Restore Your System Page.
6. Select your Time Machine Backup.
7. Select USB
8. Select the most recent backup of your Mac's hard drive.
9. Click Continue.
@nhu313
nhu313 / casino.md
Last active February 22, 2019 14:18

Casino

Create the following classes:

Card

Instance variables/Fields

  • String suite
  • String faceValue

Constructors

package com.example.interview;
import java.util.HashMap;
import java.util.Map;
public class PalindromePermutation {
public static boolean isPalindromePermutation(String value) {
Map<Character, Integer> counts = countCharacters(value);
import org.junit.Test;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class StreamTest {
@Test

Keybase proof

I hereby claim:

  • I am nhu313 on github.
  • I am nhu313 (https://keybase.io/nhu313) on keybase.
  • I have a public key ASBfHWicA2Vt4-PV4IZRnRwm4x6t4caB4Uo4OErnYJ_a8Ao

To claim this, I am signing this object:

@nhu313
nhu313 / questions.json
Created March 25, 2016 19:10
usmle questionnaire
{"question": "",
"choices": [],
"answer": "",
"explaination": ""
},
@nhu313
nhu313 / deploy_dokku.md
Last active May 15, 2018 21:03
Deploying phoenix on Dokku through Digital ocean

This write up was based on Henrik's gist

Create server

  1. Create a droplet on digital ocean. Use my referal link for $10 credit. I also credit if you spend money, so thanks in advance ;)
    1. Select "Create Droplet"
    2. Under "Choose an image", click on "One-click Apps"
    3. Select Dokku for your app
    4. Under "Choose a size" select at least 1GB of RAM
    5. Add your ssh public key
  2. Click "Create"
[error] #PID<0.302.0> running MyApp.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /todo_lists/new
** (exit) an exception was raised:
** (ArgumentError) cannot generate inputs_for for field :todo_items with type {:assoc, %Ecto.Association.Has{cardinality: :many, defaults: [], field: :todo_items, on_cast: :changeset, on_delete: :nothing, on_replace: :delete, owner: MyApp.TodoList, owner_key: :id, queryable: MyApp.TodoItem, related: MyApp.TodoItem, related_key: :todo_list_id}}
(phoenix_ecto) lib/phoenix_ecto/html.ex:164: Phoenix.HTML.FormData.Ecto.Changeset.find_inputs_for_type!/2
(phoenix_ecto) lib/phoenix_ecto/html.ex:30: Phoenix.HTML.FormData.Ecto.Changeset.to_form/4
(phoenix_html) lib/phoenix_html/form.ex:255: Phoenix.HTML.Form.inputs_for/4
(my_app) web/templates/todo_list/form.html.eex:18: anonymous fn/2 in MyApp.TodoListView.form.html/1
(phoenix_html) lib/phoenix_html/form.ex:227: Phoenix.HTML.Form.form_for/4
@nhu313
nhu313 / ci3_carousel.js
Created June 16, 2015 05:01
jQuery Carousel plugin