Skip to content

Instantly share code, notes, and snippets.

@jacquerie
jacquerie / foobar.py
Last active October 28, 2023 16:09
How to decode the message at the end of Google Foobar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
MESSAGE = '''
EUYQGhMMSx0cU0FIU1MCFAQPG01NQ0gTAEICChUGBxZTRVxBSQoZFQYKHQpKSUNURhcVEgoUFR1I
SltDSBkBTRwKEAgQHxFCSkFJDgkJCgoGCkMLAQBGUklUQhMPAgAJCgYLV0MOSR0VAxAaABZBQVRP
TRICCRVIAk5IEg4dVFRfRkYZBgRARBI=
'''
@jacquerie
jacquerie / morse.c
Last active March 10, 2022 09:36
Small C library to convert from chars to Morse Code and back.
#include <ctype.h>
#include <stdlib.h>
#include "morse.h"
/*
* Function morse_to_index by cypherpunks on Reddit.
* See: http://goo.gl/amr6A3
*/
int morse_to_index (const char* str)
@jacquerie
jacquerie / 4gq25.txt
Created January 9, 2016 14:39
$ outguess -r 4gq25.jpg 4gq25.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello.
The path lies empty; epiphany seeks the devoted.
Liber Primus is the way. Its words are the map, their
meaning is the road, and their numbers are the direction.
@jacquerie
jacquerie / grobid.py
Created October 30, 2015 15:46
Python-driven GROBID retraining
#!/usr/bin/env python
# -*- coding: utf8 -*-
import os
import grobid_core
import grobid_trainer
if __name__ == '__main__':
@jacquerie
jacquerie / addKonamiCode.js
Last active July 19, 2017 18:49
Adds a Konami Code easter egg to a page. Requires jQuery.
var addkonamiCode = function () {
var status = 0;
$("body").keydown(function (e) {
if ((e.which === 38 && (status === 0 || status === 1))
|| (e.which === 40 && (status === 2 || status === 3))
|| (e.which === 37 && (status === 4 || status === 6))
|| (e.which === 39 && (status === 5 || status === 7))
|| (e.which === 66 && status === 8)) {
status++;
@jacquerie
jacquerie / 0_reuse_code.js
Created July 8, 2016 20:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jacquerie
jacquerie / README.mdown
Last active February 8, 2016 12:55
Generate and use GROBID bindings with PyXB

Generate and use GROBID bindings with PyXB

  1. Install PyXB and IPython:

    $ pip install ipython pyxb
  2. Generate the bindings:

@jacquerie
jacquerie / stdout.txt
Created January 9, 2016 22:39
$ mdls 23.jpg
kMDItemBitsPerSample = 32
kMDItemColorSpace = "RGB"
kMDItemContentCreationDate = 2016-01-09 13:02:34 +0000
kMDItemContentModificationDate = 2016-01-09 13:02:34 +0000
kMDItemContentType = "public.jpeg"
kMDItemContentTypeTree = (
"public.jpeg",
"public.image",
"public.data",
"public.item",
@jacquerie
jacquerie / Elasticsearch percolate API
Created November 26, 2013 16:35
When run gives: {"ok":true,"_index":"_percolator","_type":"foo","_id":"barbaz1","_version":1} {"ok":true,"_index":"_percolator","_type":"foo","_id":"barbaz2","_version":1} {"ok":true,"matches":[]} Expecting: {"ok":true,"_index":"_percolator","_type":"foo","_id":"barbaz1","_version":1} {"ok":true,"_index":"_percolator","_type":"foo","_id":"barbaz…
#!/bin/bash
# Deletes, then creates the collection "foo".
curl -s -XDELETE localhost:9200/foo > /dev/null
curl -s -XPUT localhost:9200/foo > /dev/null
# Creates two percolators called "barbaz1" and "barbaz2" with different
# values in the "plugh" field.
curl -XPUT localhost:9200/_percolator/foo/barbaz1 -d '{
"plugh": "xyzzy",
#include <mpi.h>
#include <stdio.h>
int main (int argc, char** argv) {
int i, rank, size, left, right;
double A, B, SUM;
MPI_Status status;
MPI_Init(&argc, &argv);