Skip to content

Instantly share code, notes, and snippets.

@ashwinvis
ashwinvis / THANKS.md
Last active July 7, 2020 05:22
GitHub Retro
@Jackhammer9
Jackhammer9 / MyPaint.py
Created April 28, 2019 12:02
so i made a paint application no hate i am just 14
import turtle
win = turtle.Screen()
win.setup(900,600)
win.title("Jackhammer's Paint")
# ribbon
rib = turtle.Turtle()
rib.hideturtle()
rib.color('thistle')
@serge-sans-paille
serge-sans-paille / jit.py
Created November 2, 2018 07:01
Pythran-based dummy JIT compiler
import pythran
import inspect
import hashlib
import itertools
import imp
import re
def typename(obj):
# FIXME: only works for some types
return type(obj).__name__
@apatlpo
apatlpo / plot_simulations.ipynb
Created July 20, 2018 11:06
plot fluidsim output with xarray
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / README.md
Last active August 13, 2024 19:11
Polyglot Data Science with IPython

Polyglot Data Science with IPython & friends

Author: Fernando Pérez.

A demonstration of how to use Python, Julia, Fortran and R cooperatively to analyze data, in the same process.

This is supported by the IPython kernel and a few extensions that take advantage of IPython's magic system to provide low-level integration between Python and other languages.

See the companion notebook for data preparation and setup.

@dylanmckay
dylanmckay / facebook-contact-info-summary.rb
Last active November 14, 2024 18:04
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# NOTE: Requires Ruby 2.1 or greater.
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It prints all cell phone call + SMS message + MMS records, plus a summary of each.
#
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created
@insertinterestingnamehere
insertinterestingnamehere / mod.pxd
Created October 19, 2015 22:28
This shows how to wrap a C++ function in a capsule within Cython, how to call a function pointer wrapped in a capsule object, how to export that function as a part of the modules C API, and how to call that function from outside the module using ctypes.
cdef double cymul(double, double) nogil
@martinarroyo
martinarroyo / citationneeded.tex
Created June 1, 2015 22:10
A LaTeX macro that sets a Wikipedia-stylized "Citation Needed" template and outputs the counter of references with a surprise. Use with write18 enabled! and the Figures directory in \graphicspath{}!
\newcounter{undefinedreferences}
\setcounter{undefinedreferences}{0}
\newcommand{\citationneeded}[1][None]{\stepcounter{undefinedreferences}\textsuperscript{\color{blue} [Citation needed: #1]}}
\newcommand{\checkreferences}{
\ifnum\value{undefinedreferences} > 0
\begin{center}
\immediate\write18{wget -O Figures/protester.png -nc http://imgs.xkcd.com/comics/wikipedian_protester.png}
\includegraphics[width=\textwidth]{protester.png}
@XVilka
XVilka / TrueColour.md
Last active October 29, 2024 09:43
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@igniteflow
igniteflow / env-context.py
Last active December 12, 2023 16:43
A Python context manager for setting/unsetting environment variables
from contextlib import contextmanager
"""
Usage:
with env_var('MY_VAR', 'foo'):
# is set here
# does not exist here
"""