Skip to content

Instantly share code, notes, and snippets.

View mkcor's full-sized avatar

Marianne Corvellec mkcor

View GitHub Profile
@omarish
omarish / newpost.rb
Last active May 8, 2018 17:47
Script to make a new post in Jekyll.
#!/usr/bin/env ruby
require 'optparse'
options = {
:subdir => "_posts"
}
parsed = OptionParser.new do |opts|
opts.banner = 'Usage: newpost --title "post title" [options]'
@AustinRochford
AustinRochford / pydata-nyc-2017-nba-fouls-python.ipynb
Last active December 22, 2017 16:22
PyData NYC 2017 Understanding NBA Foul Calls with Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wowkin2
wowkin2 / blockchain.py
Last active May 18, 2018 09:13
Simple implementation of blockchain by example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib as hasher
import datetime as date
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
@rupey
rupey / mandelbrot.sql
Last active December 7, 2020 05:38
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
@turingbirds
turingbirds / GNUPG Cheatsheet.md
Last active December 28, 2024 06:58
GPG (GNUPG) Cheatsheet

GNUPG CHEATSHEET

Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key

$ gpg --list-secret-keys

@jennybc
jennybc / 2014-10-12_stop-working-directory-insanity.md
Last active May 1, 2025 19:00
Stop the working directory insanity

There are packages for this now!

2017-08-03: Since I wrote this in 2014, the universe, specifically Kirill Müller (https://github.com/krlmlr), has provided better solutions to this problem. I now recommend that you use one of these two packages:

  • rprojroot: This is the main package with functions to help you express paths in a way that will "just work" when developing interactively in an RStudio Project and when you render your file.
  • here: A lightweight wrapper around rprojroot that anticipates the most likely scenario: you want to write paths relative to the top-level directory, defined as an RStudio project or Git repo. TRY THIS FIRST.

I love these packages so much I wrote an ode to here.

I use these packages now instead of what I describe below. I'll leave this gist up for historical interest. 😆