Skip to content

Instantly share code, notes, and snippets.

View armand1m's full-sized avatar

Armando Magalhães armand1m

View GitHub Profile
@coproduto
coproduto / example.hs
Last active September 11, 2020 00:07
data ReadState = None | Input | Output
split :: (Char -> Bool) -> String -> [String]
split f s = let (prefix, rest) = break s in
case rest of
[] -> [prefix]
[c] -> [prefix]
(c:cs) -> prefix : (split f cs)
main :: IO ()
@lunks
lunks / circle-ci-config.yml
Last active September 4, 2023 21:17
React Native with Expo app publishing in Circle CI
---
version: 2.1
aliases:
- &install_yarn_dependencies
run:
name: Install yarn dependencies
command: yarn install --frozen-lockfile --ignore-engines
- &update_yarn
run:
name: Update yarn
@simpsoka
simpsoka / Leadership-CI.md
Last active December 20, 2023 15:40
This is a list of questions to check our decision making.

Do I want to die on this hill?

  • Pass: This is morally good and if not handled has long term consequences
  • Fail: This if self serving

Am I including everyone?

  • Pass: My ego is not driving this conversation
  • Fail: The people in this conversation will only tell me I'm right and not push back
-- 1) Upgraded to Data.Time 2) Added some timings. 3) 10 million.
-- Otherwise unchanged
-- Result: 14 seconds versus 70 seconds for List.sort, 2.1 GB ram used
-- google: haskell etl
-- > https://www.reddit.com/r/ocaml/comments/3ifwe9/what_are_ocamlers_critiques_of_haskell/
-- > https://www.reddit.com/r/haskell/comments/3inqzk/an_optimal_haskell_quicksort/
-- > http://flyingfrogblog.blogspot.com/2010/08/parallel-generic-quicksort-in-haskell.html
{-# LANGUAGE FlexibleContexts #-}
-- import System.Time
@joepie91
joepie91 / wildcard-certificates.md
Last active June 3, 2024 02:07
Why you probably shouldn't use a wildcard certificate

Recently, Let's Encrypt launched free wildcard certificates. While this is good news in and of itself, as it removes one of the last remaining reasons for expensive commercial certificates, I've unfortunately seen a lot of people dangerously misunderstand what wildcard certificates are for.

Therefore, in this brief post I'll explain why you probably shouldn't use a wildcard certificate, as it will put your security at risk.

A brief explainer

It's generally pretty poorly understood (and documented!) how TLS ("SSL") works, so let's go through a brief explanation of the parts that are important here.

The general (simplified) idea behind how real-world TLS deployments work, is that you:

@developit
developit / unistore.js
Last active September 8, 2020 15:13
Update: the newer & better version of this is published: https://github.com/developit/unistore
import { h, Component } from 'preact';
/** Creates a new store, which is a tiny evented state container.
* @example
* let store = createStore();
* store.subscribe( state => console.log(state) );
* store.setState({ a: 'b' }); // logs { a: 'b' }
* store.setState({ c: 'd' }); // logs { c: 'd' }
*/
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@JamieMason
JamieMason / .babelrc
Created December 5, 2016 08:41
Tree-Shaking with Babel 6, Webpack 2, and React.
{
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}
}], "react"
]
}
@armand1m
armand1m / Dockerfile
Last active March 10, 2024 14:54
Yarn cache compatible Dockerfile
FROM alpine
RUN apk add --update --no-cache nodejs
RUN npm i -g yarn
ADD package.json yarn.lock /tmp/
ADD .yarn-cache.tgz /
RUN cd /tmp && yarn
RUN mkdir -p /service && cd /service && ln -s /tmp/node_modules
@prash-wghats
prash-wghats / Readme_VSCODE_FreeBSD
Last active June 4, 2021 08:21
Notes for Building Electron and VSCode in FreeBSD11
Copy all the files to the build directory.
Copy icudtl.dat to the build directory. (you can find it in the vscode downloads ex for linux).
chromium version in port is 52.0.2743.116.
This was built with FreeBSD 11.0-RELEASE-p1. If building with other versions probably need to change
the freebsd versions in diff files (ex. freebsd11 => freebsd10)
Installed
node => v6.9.1
npm => 3.9.2
>chmod 755 vscode_build.sh