Skip to content

Instantly share code, notes, and snippets.

@Khady
Khady / config.el
Last active February 27, 2023 12:25
OCaml and Reasonml emacs configuration
(use-package company
:ensure t
:custom
(company-quickhelp-delay 0)
(company-tooltip-align-annotations t)
:hook
((prog-mode utop-mode) . company-mode)
:config
(company-quickhelp-mode 1)
:bind
@Khady
Khady / user.json
Created February 2, 2018 03:17
VScode configuration to have schema validation while editing bsconfig.json (reasonml, bucklescript)
{
"json.schemas": [
{
"fileMatch": [
"bsconfig.json"
],
"url": "https://bucklescript.github.io/bucklescript/docson/build-schema.json"
}
]
}
@Khady
Khady / Makefile
Last active October 23, 2017 06:04
Reproduction for problem with compilation buffer in emacs
default:
ls -1 /bin
@Khady
Khady / tasks.json
Created June 14, 2017 07:17
VSCode task to compile OCaml
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"tasks": [
{
"taskName": "make",
"isBuildCommand": true,
"command": "make",
"options": {
@Khady
Khady / gist:a70c3892e89dbc8d82d4881ac3f550de
Created May 31, 2017 09:23 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@Khady
Khady / keybase.md
Created July 28, 2016 11:28
keybase.md

Keybase proof

I hereby claim:

  • I am khady on github.
  • I am louisroche (https://keybase.io/louisroche) on keybase.
  • I have a public key ASAiO10BFKGBUzA0B1Lhdzoqq_OSiVeWw1ga7QeSxdFaPwo

To claim this, I am signing this object:

@Khady
Khady / tests_hammer.bash
Last active August 29, 2015 14:01
Fix the usage
#! /usr/bin/env bash
## tests_hammer.bash for onitu
## by lenormf
##
function log {
echo "$@" 1>&2
}
function fatal {

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

module Random = struct
let m = Array.create 17 0
let i = ref 4
let j = ref 16
let mdig = 32
let m1 = (1 lsl (mdig - 2)) + (1 lsl (mdig - 2)) - 1
let m2 = 1 lsl (mdig / 2)
let dm1 = 1.0 /. (2. ** float(mdig-1) -. 1.)
let nextDouble() =
extern mod pcre;
extern mod std;
use std::getopts::*;
use std::time::*;
use std::map::HashMap;
use std::map::Map;
use std::map::;
// struct context {
// // year: ~str,