Skip to content

Instantly share code, notes, and snippets.

View danyim's full-sized avatar

Daniel Yim danyim

View GitHub Profile
@solkaz
solkaz / detox-ts.md
Last active August 24, 2023 11:06
Writing Detox Tests with TypeScript

Usage

This guide assumes you've got a project using Detox with Jest, and you want to write your Detox tests in TypeScript.

  • Refer to this guide if you need to set up such a project.

1. Add TypeScript + ts-jest to package.json

We'll be using ts-jest to run Jest tests with TypeScript.

1 pound red kidney beans 1 link of Hillshire Farms smoked sausage (like polish
style) 1 celery stalk 1 yellow onion 1-2 bay leaves Ground cayenne pepper Brown
rice or long-grain white rice Crystal brand hot sauce
This is my pressure cooker adaptation of my mother-in-law's recipe.
Rinse 1 pound of red kidney beans, then cover with 3-4" of water and soak
overnight. The next morning, dump the water and rinse them thoroughly.
Chop one medium-sized yellow onion and one celery stalk.
@speeddragon
speeddragon / kali-linux-wl-fix.sh
Last active February 18, 2024 13:05
Kali Linux fix for "modprobe: FATAL: Module wl not found"
# Update and install necessary packages
apt-get update
apt-get install linux-image-$(uname -r|sed 's,[^-]*-[^-]*-,,') linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
# Download some extra packages, that do the trick for "wl module not found"
wget http://http.kali.org/kali/pool/main/l/linux-tools/linux-kbuild-4.3_4.3.1-2kali1_amd64.deb
wget http://http.kali.org/kali/pool/main/l/linux/linux-headers-4.3.0-kali1-common_4.3.3-5kali4_amd64.deb
wget http://http.kali.org/kali/pool/main/l/linux/linux-headers-4.3.0-kali1-amd64_4.3.3-5kali4_amd64.deb
# Install with correct order
@danyim
danyim / findEq.js
Last active July 10, 2019 21:14
Brute-force algorithm for finding a valid equation for a given string of numbers
/*
The first 12 digits of pi are 314159265358. We can make these digits into an
expression evaluating to 27182 (first 5 digits of e) as follows:
3141 * 5 / 9 * 26 / 5 * 3 - 5 * 8 = 27182
or
3 + 1 - 415 * 92 + 65358 = 27182
Notice that the order of the input digits is not changed. Operators (+,-,/,
or *) are simply inserted to create the expression.

Tech Interview Prep

@ Hacker Dojo 7/9/2016

Algorithms

Ordered Statistic Trees

  • Problem: Given a stream of integers, you should be able to provide the median at any given time..
    • Ex. input: [2, 8, 5, 3, 4, 2, .. ]
      • Output (medians at i): [2, 2, 5, 3, 4, 3, 3]
  • Assumption: if you have an even number of values, the lower value is the median
@mattes
mattes / make-a-call.alfredworkflow
Last active June 16, 2021 18:20
Place a call from Alfred using your iPhone (Mac OS X Yosemite & iOS 8)
@matthewberryman
matthewberryman / setup_rds_postgis.sql
Last active January 2, 2021 11:53
Setup postgis in Amazon RDS
-- taken from http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.PostGIS
create extension postgis;
create extension fuzzystrmatch;
create extension postgis_tiger_geocoder;
create extension postgis_topology;
alter schema tiger owner to rds_superuser;
alter schema tiger_data owner to rds_superuser;
alter schema topology owner to rds_superuser;
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@alinpopa
alinpopa / gist:1281448
Created October 12, 2011 15:05 — forked from vshkurin/gist:1109136
elasticsearch analyzer example - Test Queries
# Index
---------------------------------------------------------------------
curl -XPUT http://localhost:9200/pictures/ -d '
{
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",