Skip to content

Instantly share code, notes, and snippets.


Lucas AgtLucas

Block or report user

Report or block AgtLucas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
let str = ReasonReact.string;
let url = "http://localhost:3000/users";
type user = {
id: int,
name: string,
type state =
AgtLucas / facebook-contact-info-summary.rb
Created Mar 22, 2018 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
View facebook-contact-info-summary.rb
#! /usr/bin/env ruby
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
# It dumps all cell phone call + SMS message + MMS records, plus a summary of each.
# Place this script inside the extracted Facebook data download folder
# alongside the 'html' folder.
AgtLucas / login.js
Created Mar 15, 2018 — forked from kentcdodds/login.js
Example of a test that doesn't use enzyme or TestUtils
View login.js
import React from 'react'
function Login({onSubmit}) {
return (
onSubmit={e => {
const {username, password} =
AgtLucas / pwnd.js
Created Mar 2, 2018 — forked from jgrahamc/pwnd.js
Cloudflare Workers that adds an "Cf-Password-Pwnd" header to a POST request indicating whether the 'password' field appears in Troy Hunt's database of pwned passwords.
View pwnd.js
addEventListener('fetch', event => {
async function fetchAndCheckPassword(req) {
if (req.method == "POST") {
try {
const post = await req.formData();
const pwd = post.get('password')
const enc = new TextEncoder("utf-8").encode(pwd)
AgtLucas / patternMatch.hs
Created Feb 17, 2018 — forked from animatedlew/patternMatch.hs
Here are some examples of pattern matching in Haskell.
View patternMatch.hs
-- Haskell will match starting at the top, until it hits a catchall
factorial :: Int -> Int
factorial 0 = 1
factorial n = n * factorial(n - 1)
-- Haskell is able to match empty lists and x:xs patterns
head' :: [a] -> a
head' [] = error "No head available on empty lists!"
head' (x:_) = x
AgtLucas /
Created Feb 10, 2018 — forked from broerjuang/
This is the implementation of thinking in react using reason
type product = {
category: string,
price: string,
stocked: bool,
name: string
type products = list(product);
let products = [
AgtLucas / bsconfig.json
Created Jan 23, 2018 — forked from FiberJW/bsconfig.json
Example ReasonReact BuckleScript Configuration
View bsconfig.json
"name": "<Your App Name Here />",
"reason": {
"react-jsx": 2
"bsc-flags": ["-bs-super-errors"],
"bs-dependencies": ["reason-react"],
"sources": [
"dir": "./src",

Basic Algorithm

  1. A secret byte you want to read is stored at inaccessible memory location priv_mem.
  2. The sender triggers an access exception by attempting to access priv_mem.
  3. Due to out-of-order execution, the load of secret and its access in step 4 may happen before the exception fires.
  4. Calculate an offset into a known array probe by multiplying secret by the width of a cache line.
  5. This forces the cache to load probe[offset], caching exactly one chunk of our array.
  6. The exception fires, clearing the modified registers, but cached data is not excised.
  7. Iterate over all 256 offsets into probe to find out which one loads fast. You've determined the value of secret.
AgtLucas / array-reduce.js
Created Nov 15, 2017 — forked from edysegura/array-reduce.js
[JS] Using reduce to calculate average
View array-reduce.js
var scores = [1, 4, 6, 8];
var result = scores.reduce((total, score) => total + score) / scores.length;
console.log(result); // 4.75
AgtLucas /
Created Nov 11, 2017 — forked from sibelius/
How to easily type Redux Props with Flow

How to easily type Redux Props with Flow

Add ExtractReturn helper

// eslint-disable-next-line no-unused-vars
type _ExtractReturn<B, F: (...args: any[]) => B> = B;
export type ExtractReturn<F> = _ExtractReturn<*, F>;
You can’t perform that action at this time.