Skip to content

Instantly share code, notes, and snippets.

View aotarola's full-sized avatar
🎯
Focusing

Andres Otarola aotarola

🎯
Focusing
View GitHub Profile
@bsag
bsag / README.md
Last active July 12, 2023 19:38
Selected files from my standalone Nix/Home Manager set up on macOS to illustrate the general approach

These files illustrate the way that I have set up Nix and Home Manager for standalone use on macOS on both an Intel and Apple Silicon machine, in case the examples are useful to anyone. Some of the configuration is separated out into separate files in configs/ which get imported in home.nix. Some of my existing dotfiles are placed in dotfiles/ and then symlinked in by Nix to the location that that the system expects to find them.

It is a work in progress so currently I am handling installation of R separately.

@Janiczek
Janiczek / elm-make-readable.mjs
Created April 15, 2022 19:46
elm-make-readable
import fs from 'fs/promises';
const rules = [
{
rule: /var ([^=]+)( = F\d\([^f]+function)[^(]\(/gmi,
replacement: `var $1$2 __$1( `,
},
{
rule: /(\sA\d\([\s]+)([^,]+)(,[\s]+)(function[^(]+)\(/gm,
replacement: `$1$2$3$4___$2(`,
},
@sebastiandeutsch
sebastiandeutsch / api.js
Created January 8, 2017 01:42
Basic fetch abstraction I use for many of my projects.
import 'whatwg-fetch';
import Config from 'config/Config';
export const corsFetchOptions = {
// Enable cross-domain requests (CORS)
mode: 'cors',
// Send credentials cross-domain
credentials: 'include'
};
@kutyel
kutyel / facebook.js
Last active October 11, 2020 17:31
Question for my Frontend Interview at Facebook
/*
* Create an event emitter that goes like this
* emitter = new Emitter();
*
* Allows you to subscribe to some event
* sub1 = emitter.subscribe('function_name', callback1);
* (you can have multiple callbacks to the same event)
* sub2 = emitter.subscribe('function_name', callback2);
*
* You can emit the event you want with this api
@pdamoc
pdamoc / Component.elm
Last active June 27, 2016 08:09
Counter through JS
module Component exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
import Ports exposing (..)
-- MODEL
@pdamoc
pdamoc / Counter.elm
Last active May 19, 2016 20:37
Widget Union
module Counter exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
-- MODEL
type alias Model = Int
@subfuzion
subfuzion / curl.md
Last active July 3, 2024 11:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@shamrin
shamrin / First.elm
Last active April 7, 2017 15:07
Multiple Elm main modules
module First where
import Html exposing (span, text)
main = span [ ] [text "Hello First!"]
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note