Skip to content

Instantly share code, notes, and snippets.

View yrezgui's full-sized avatar

Yacine Rezgui yrezgui

View GitHub Profile
@busypeoples
busypeoples / Heap.re
Last active July 29, 2018 10:43
Data Structures in ReasonML: #7 Heap
/* Heap */
exception Not_Found;
module type Ord = {type t; let compare: (t, t) => int;};
module Integer = {
type t = int;
let compare = (a, b) => a - b;
};
type state = {
email: string,
password: string,
message: string,
};
type action =
| Submit
| ChangeEmail(string)
| ChangePassword(string)
@vjeux
vjeux / x.md
Last active January 6, 2024 07:15
Ocaml / functional programming

I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...

@blinkinglight
blinkinglight / gist:cc139d69669fd509363ea90eff54e02b
Last active July 8, 2024 09:23
golang http context example
package main
import (
"context"
"fmt"
"github.com/nats-io/nuid"
"log"
"net/http"
)
@sirodoht
sirodoht / migrate-django.md
Last active September 22, 2025 17:30
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on PostgreSQL. Then:

@walteranyika
walteranyika / GetIMAGEAND COMPRESS.java
Created July 5, 2017 13:55
Get image from gallery, compress and upload
package com.victor.surebets;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.RequestParams;
import com.loopj.android.http.TextHttpResponseHandler;
import android.Manifest;
import android.app.ProgressDialog;
import android.content.ContentUris;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active October 7, 2025 16:12
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / recover_source_code.md
Last active September 14, 2025 04:26
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@Arinerron
Arinerron / permissions.txt
Last active October 26, 2025 18:44
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO