Skip to content

Instantly share code, notes, and snippets.

View lxm1117's full-sized avatar

Ximi lxm1117

  • Ohio University, Technion, NYUAD
  • X @ximi_qb
View GitHub Profile
@andrejbauer
andrejbauer / LaTeX.inputplugin
Last active February 19, 2026 04:13
LaTeX symbols input method for MacOS
#
METHOD: TABLE
ENCODE: Unicode
PROMPT: LaTeX
VERSION: 1.0
DELIMITER: ,
VALIDINPUTKEY: ^,.?!:;"'/\()[]{}<>$%&@*01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
TERMINPUTKEY:
BEGINCHARACTER
alpha α
pragma solidity ^0.4.0;
import "SafeMath.sol";
import "IERC20Token.sol";
/**
* @dev Implements a capped token sale using a second-price auction.
*
* @author Nick Johnson <arachnid@notdot.net>
*
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import blessed
from collections import defaultdict
import csv
import jinja2
import logging
import numpy
@danstowell
danstowell / wiener_deconvolution_example.py
Last active October 1, 2025 12:43
Simple example of Wiener deconvolution in Python
#!/usr/bin/env python
# Simple example of Wiener deconvolution in Python.
# We use a fixed SNR across all frequencies in this example.
#
# Written 2015 by Dan Stowell. Public domain.
import numpy as np
from numpy.fft import fft, ifft, ifftshift
anonymous
anonymous / gist:24091d997bfa48920efb
Created September 1, 2015 03:21
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05775316/C05775316.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05776580/C05776580.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05776479/C05776479.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05777242/C05777242.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05775315/C05775315.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05776573/C05776573.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05777196/C05777196.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05775318/C05775318.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05776679/C05776679.pdf
https://foia.state.gov/searchapp/DOCUMENTS/HRCEmail_August_Web/IPS-0128/DOC_0C05777256/C05777256.pdf
@zachmayer
zachmayer / openblas.sh
Last active March 14, 2022 03:20
Mac BLAS
#Option 1 - install openblas with homebrew and link to CRAN installed R
brew tap homebrew/science
brew install openblas
ln -sf /usr/local/Cellar/openblas/0.2.12/lib/libopenblas.dylib /Library/Frameworks/R.framework/Resources/lib/libRblas.dylib
#Option 2 - install r with openblas through homebrew
brew tap homebrew/science
brew install r --with-openblas
@gbl08ma
gbl08ma / tny
Created July 30, 2013 17:40
Unix shell script to shorten URLs with tny.im URL shortener. wget must be installed for this to work.
#!/bin/sh
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo "usage: tny long_url [custom_keyword]"
echo ""
echo "Shorten URLs with tny.im URL shortener"
echo "This script expects a long URL to shorten either as an argument or passed through STDIN."
echo "When using arguments, an optional second argument can be provided to customize the later part of the short URL (keyword)."
exit 1
fi
@thbar
thbar / how-to-diff-pdf-files-with-git-and-diffpdf.md
Last active March 9, 2026 18:07
How to diff PDF files with Git

One can use MD5 or plain text diff to see differences in PDF files. If that's not enough, here's how to use diff-pdf which knows how to diff based on appearance or words:

  • brew install diff-pdf
  • edit your ~/.gitconfig to add this:
[difftool "diffpdf"]
  cmd = diff-pdf --view \"$LOCAL\" \"$REMOTE\"
@tonious
tonious / hash.c
Last active June 21, 2024 00:57
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>