Skip to content

Instantly share code, notes, and snippets.

View mratsim's full-sized avatar
:shipit:

Mamy Ratsimbazafy mratsim

:shipit:
  • Paris
View GitHub Profile
# Copyright 2017 Mamy André-Ratsimbazafy
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
import linalg
{.experimental.}
# Global templates
template foreach(expression, iter: untyped): untyped =
for element in mitems(iter):
expression(element)
@probonopd
probonopd / elfsize.c
Last active February 3, 2025 08:38
Calculate the size of an ELF file on disk based on the information in its header
/*
Compile with:
gcc elfsize.c -o elfsize
Example:
ls -l 126584
@thacoon
thacoon / arch-linux-gnome-install
Last active March 22, 2025 06:30
Install a minimal gnome setup and some more useful things
# Install Gnome and some other useful thins
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# And based on https://wiki.archlinux.de/title/Anleitung_f%C3%BCr_Einsteiger
# I have just copied commands from https://wiki.archlinux.de/title/Anleitung_f%C3%BCr_Einsteiger#Weitere_notwendige_Dienste
# It's just to have it with one view after doing a [fresh installation](https://gist.github.com/thacoon/05d5a39606ab554455d6713e8a714b2c)
# Some useful services
pacman -S acpid ntp dbus cups cronie
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active April 25, 2025 13:56 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@ischlag
ischlag / mnist-to-jpg.py
Last active January 23, 2024 06:45
Simple python script which takes the mnist data from tensorflow and builds a data set based on jpg files and text files containing the image paths and labels. Parts of it are from the mnist tensorflow example.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import sys
import time
from six.moves import urllib
@bbengfort
bbengfort / sentiment.py
Last active December 27, 2022 05:17
An end-to-end demonstration of a Scikit-Learn SVM classifier trained on the positive and negative movie reviews corpus in NLTK.
import os
import time
import string
import pickle
from operator import itemgetter
from nltk.corpus import stopwords as sw
from nltk.corpus import wordnet as wn
from nltk import wordpunct_tokenize
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@artjomb
artjomb / PairingLibs.md
Last active March 27, 2025 02:50
List of Pairing Libraries

Pairings can be used for all kinds of advanced cryptographic schemes such as Encryption (Identity-based, Attribute-based, Predicate-based, etc.), Signatures, Zero-Knowledge Proofs, etc. It is in no particular order.

Provides multiple types of Elliptic Curve groups with appropriate pairings on top of them. Code repository resides here.

License: LGPL
Language: C
Thesis: On the Implementation of Pairing-Based Cryptography by Ben Lynn (2007)