Skip to content

Instantly share code, notes, and snippets.

View Alex-Linhares's full-sized avatar

Alexandre Linhares Alex-Linhares

View GitHub Profile
@Aerijo
Aerijo / latex_in_atom.md
Last active July 31, 2023 09:31
Setting up Atom for LaTeX

Disclaimer: I wrote the packages language-latex2e, autocomplete-latex, latex-wordcount, and hyperclick-latex. I still try to provide a list of all useful packages though, so let me know if I have missed one.

This is a general guide for how to get started with LaTeX in Atom.

NOTE: This guide assumes you already have LaTeX installed on your computer. If you do not, I recommend TeX Live.

anonymous
anonymous / cryptovisual_qr_encoder
Created August 7, 2014 18:07
create two random-looking images that reveal a QR code when superposed
#!/bin/bash
# This script reads text from stdin, generates its QR code and splits it into two visual cryptographic images. Both images appear random and have as many whites as blacks. Only when print on transparent film (or extremely thin paper) and superposed, the ciphered qrcode appears as gray/black dots.
# We use the program "qrencode" to generate a QR at an average 7% error-correction rate ("low" quality; the lowest available). We create then a random array and we visual-XOR it with the QR code to retrieve the ciphered code. Only the random array (nonce or one-time pad) and the ciphered array are recorded, and only when both are superposed they reveal the QR code.
# The visual-cryptographic scheme used is inspired of http://leemon.com/crypto/VisualCrypto.html . It transforms 0s and 1s into diagonal 2x2 squares (01\10 and 10\01). The visual XOR either repeats (gray superposition; corresponding to a white dot) or flips (black superposition; corresponding to a black dot), following the QR code.
# Security
@erikhazzard
erikhazzard / gist:6602963
Created September 18, 2013 00:53
Install CUDA, OpenCL, and PyOpenCL on EC2 with Ubuntu 12.04
#!/bin/bash
sudo apt-get update
sudo apt-get install gcc
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1204_5.5-0_amd64.deb
sudo apt-get update
sudo apt-get install cuda
export PATH=/usr/local/cuda-5.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:$LD_LIBRARY_PATH
sudo apt-get install opencl-headers python-pip python-dev python-numpy python-mako
@inducer
inducer / scan.cl
Created July 24, 2012 04:35
PyOpenCL scan code generator
#define K ${k_group_size}
KERNEL
REQD_WG_SIZE(WG_SIZE, 1, 1)
void ${name_prefix}_scan_intervals(
${argument_signature},
GLOBAL_MEM scan_type *partial_scan_buffer,
const index_type N,
const index_type interval_size