Skip to content

Instantly share code, notes, and snippets.

View evadne's full-sized avatar
🎣
gone fishing

Evadne Wu evadne

🎣
gone fishing
View GitHub Profile
@evadne
evadne / About.md
Last active April 9, 2024 07:19
Create display override file to force Mac OS X to use RGB mode for Display.

Create display override file to force Mac OS X to use RGB mode for Display.

  • Dell (4268) = 0x40ac
  • U3011 (16485) = 0x4065: /System/Library/Displays/Overrides/DisplayVendorID-10ac/DisplayProductID-4065
  • U2713HM (16512) = 0x4080: /System/Library/Displays/Overrides/DisplayVendorID-10ac/DisplayProductID-4080

Credit: http://embdev.net/topic/284710; works for OS X 10.8 & last tested on 10.9 13A476u.

@evadne
evadne / gist:440558b18228ca657ef22b465793a0c3
Last active April 5, 2024 14:11
Using SchemaCrawler on PostgreSQL databases
@evadne
evadne / a-reverse-bench.exs
Last active January 5, 2024 10:57
Reversing Binaries in Elixir
defmodule Benchmarker do
def run(title, module, function, size \\ 1024, iterations \\ 100) do
times = for (_ <- 1 .. iterations) do
data = :crypto.strong_rand_bytes(size)
{duration, _value} = :timer.tc fn ->
apply(module, function, [data])
end
duration
end
@evadne
evadne / console.ex
Last active November 5, 2023 18:36
Elixir Tic Tac Toe with Minimax
defmodule TTT.Console do
def print(board) do
at = fn index ->
case elem(board, index) do
nil -> " "
:X -> "X"
:O -> "O"
end
end
@evadne
evadne / lecture.md
Last active October 4, 2023 23:24
How to Sell Elixir (2023)

How to Sell Elixir AGAIN (2023)

Presented by Evadne Wu at Code BEAM Lite in Stockholm, Sweden on 12 May 2023

Synopsis

We have celebrated 10 years of Elixir and also nearly 25 years of Erlang since the open source release in December 1998.

Most of the libraries that were needed to make the ecosystem viable have been built, talks given, books written, conferences held and training sessions provided. A new generation of companies have been built on top of the Elixir / Erlang ecosystem. In all measures, we have achieved further reach and maturity than 5 years ago.

@evadne
evadne / gist:4544569
Last active August 14, 2023 05:04
Todd Laney’s enhancements to Sticky Headers + UICollectionViewFlowLayout
//
// StickyHeaderLayout.h
// Wombat
//
// Created by Todd Laney on 1/9/13.
// Copyright (c) 2013 ToddLa. All rights reserved.
//
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS!
//
out.txt
out-sorted.txt
words.txt
@evadne
evadne / 0_CONTRIBUTORS.md
Last active July 14, 2023 12:52
RVM + MRI + Capistrano + Puma + Sidekiq
  • Josh Goebel (@yyyc514): suggested lazy evaluation on set
@evadne
evadne / 01-multistage-build.sh
Last active July 11, 2023 06:33
Build & Cache multi-stage Docker images (with Build Specification for AWS CodeBuild)
# the general idea
ImageTag="git"
FilePath="/Dockerfile"
RepoURI="123456789012.dkr.ecr.eu-west-1.amazonaws.com/repo"
Stages=$(cat $FilePath | grep -oP '^FROM .+ (AS|as) \K(.+)$')
CacheArgs=$(for Stage in $Stages; do echo "--cache-from $RepoURI:cache-$Stage"; done | paste -sd ' ')
BuildArgs="--file $FilePath $CacheArgs"
for Stage in $Stages; do docker pull $RepoURI:cache-$Stage || true; done
for Stage in $Stages; do docker build $BuildArgs --tag $RepoURI:cache-$Stage --target $Stage . || break; done
docker build $BuildArgs --tag $RepoURI:$ImageTag .
@evadne
evadne / gist:5794585
Last active April 18, 2023 18:01
WWDC 2013 Videos / Slides (PDF) Downloader — run in a JavaScript console / interpreter hooked to the videos page
// Download all assets from https://developer.apple.com/wwdc/videos
// Warning: might take up a lot of disk space
NodeList.prototype.toArray = function () {
return Array.prototype.slice.call(this);
};
[].concat.apply([], document.querySelectorAll("li.session").toArray().map(function(session){
var sessionID = session.id.match(/^\d+/)[0];
var title = session.querySelector(".title").innerText;