Skip to content

Instantly share code, notes, and snippets.


Tim Wisniewski timwis

View GitHub Profile
squarism / multiline.exs
Last active Mar 17, 2020
Multiline Anonymous Functions in Elixir
View multiline.exs
# Examples of Different Styles and Syntax
# legal / positive case / you can do these stuffs
# ---------------------------------------------------------------------------
# single line, nothing special, fn i -> IO.puts i end)
maxivak /
Last active Jan 25, 2021
Webpack, Yarn, Npm in Rails
getify /
Last active Oct 15, 2020
BetterPromise: a strawman experiment in subclassing Promise and "fixing" a bunch of its awkward/bad parts

Some things that are "better" with this BetterPromise implementation:

  • BetterPromise # then(..) accepts a BetterPromise (or Promise) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.

    var p = BetterPromise.resolve(42);
    var q = Promise.resolve(10);
grishgrigoryan / IterableFile.ts
Created May 4, 2018
Helper to iterate over file in browser using for-await-of loop
View IterableFile.ts
interface IConfig{
class IterableFile implements AsyncIterable<string>{
private reader : FileReader;
private file:File
private config : IConfig = {chunkSize : 64 * 1024}
constructor( file:File,config :Partial<IConfig> = {}){
this.file = file
jpbecotte /
Last active Aug 23, 2020
Vue-cli 3, Phoenix 1.3, a complete how-to


I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:

  • I want to use the new Vue-cli to select the features that I want,
  • I do NOT want to setup Webpack (I know, what a shame!). The new Vue-cli includes the new vue-cli-service, which uses an instance of webpack-dev-server, so you don't have to import it manually in your project.
  • I do not want to use Brunch.

Create your Phoenix App

Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.

joepie91 / .md
Last active Mar 20, 2019
Useful tools for working with NixOS
mafintosh /
Last active Jun 21, 2018
Resets the npm defaults to how they used to be
npm config set loglevel http
npm config set progress false
npm config set package-lock false
npm config set save false
mkdir -p ~/.config/configstore/
printf '{"optOut": true,"lastUpdateCheck": 0}' > ~/.config/configstore/update-notifier-npm.json
timwis / get-schema.sql
Last active May 4, 2017
Get postgres table schema including keys/constraints
View get-schema.sql
pg_catalog.col_description(cls.oid, cols.ordinal_position::int)::jsonb
pg_catalog.pg_class cls,
allejo / division.html
Last active Dec 2, 2016
Do division in Liquid templates with support for decimals
View division.html
{% capture whitespace %}
{% assign wholeNum = include.number | divided_by: include.divsor %}
{% assign remainder = wholeNum | times: include.divsor | minus: include.number | times: -1 %}
{% capture output %}{{ wholeNum }}.{% endcapture %}
{% for i in (1..include.decimals) %}
{% assign newNumer = remainder | times: 10 %}
{% assign workspace = newNumer | divided_by: include.divsor %}
{% assign remainder = workspace | times: include.divsor | minus: newNumer | times: -1 %}