Skip to content

Instantly share code, notes, and snippets.

View chetgray's full-sized avatar

Chet Gray chetgray

View GitHub Profile
anonymous
anonymous / costa_rica.csv
Created March 4, 2018 18:38
artisan csv files
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Date:03.02.2017 Unit:F CHARGE:00:59 TP:01:45 DRYe:06:13 FCs:09:28 FCe: SCs: SCe: DROP:11:58 COOL: Time:18:12
Time1 Time2 BT ET Event Gas*30 Extra 2 "Gas*10""WC" Extra 2
00:04 416.75 412.95 162.64 2.63 26.32 1.0
00:07 417.7 412.85 162.86 2.64 26.43 1.0
00:09 418.1 412.9 162.46 2.62 26.23 1.0
00:12 417.8 413.2 162.12 2.61 26.06 1.0
00:16 417.5 413.55 162.48 2.62 26.24 1.0
00:19 416.8 413.025 153.8 2.19 21.9 1.0
00:22 416.25 412.5 153.52 2.18 21.76 1.0
00:25 415.8 410.85 153.72 2.19 21.86 1.0
@akora
akora / remove-diacritics-google-sheet
Created February 28, 2015 11:18
Removes all diacritics from strings (e.g. names) in a Google spreadsheet
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C2,"ö","o"),"ü","u"),"ó","o"),"ő","o"),"ú","u"),"é","e"),"á","a"),"ű","u"),"í","i"),"Ö","O"),"Ü","U"),"Ó","O"),"Ő","O"),"Ú","U"),"É","E"),"Á","A"),"Ű","U"),"Í","I")
@pbugnion
pbugnion / ipython_notebook_in_git.md
Last active October 22, 2023 12:25
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.

@erickoledadevrel
erickoledadevrel / xmlToJson.js
Created December 1, 2014 14:30
A function to convert an XML string to a JSON object in Apps Script, using logic similar to the sunset method Xml.parse().
/**
* Converts an XML string to a JSON object, using logic similar to the
* sunset method Xml.parse().
* @param {string} xml The XML to parse.
* @returns {Object} The parsed XML.
*/
function xmlToJson(xml) {
var doc = XmlService.parse(xml);
var result = {};
var root = doc.getRootElement();
@shakna-israel
shakna-israel / googlecalendarapicurrentevents
Created August 8, 2014 06:14
Google Calendar - Current Events via API
<script type="text/javascript">
<!--
/**
* Converts an xs:date or xs:dateTime formatted string into the local timezone
* and outputs a human-readable form of this date or date/time.
*
* @param {string} gCalTime is the xs:date or xs:dateTime formatted string
* @return {string} is the human-readable date or date/time string
*/
function formatGCalTime(gCalTime) {
@inklesspen
inklesspen / post-checkout.py
Created June 10, 2014 21:54
Post-checkout hook to detect alembic issues when switching branches.
#!/usr/bin/env python
"""
Provide useful alembic information after switching branches.
"""
import argparse
import subprocess
import os
import os.path
import py.path
@iani
iani / jekyll-google-calendar
Created February 9, 2014 22:09
Embed google calendar in a web page for rendering by Jekyll. Copied from: https://github.com/StevenBlack/qst-jekyll-bootstrap/blob/master/calendar.html see it in action here: http://www.queenssailing.ca/calendar/
---
layout: page
title: Queen's Sailing Calendar
permalink: /calendar/
type: info
header_text: Queen's Sailing Calendar
calendar: true
---
<div class="span3">
<h3>List of 2013 Events</h3>
@stucchio
stucchio / basic_income_with_death_estimate.py
Created November 15, 2013 20:51
Same as https://gist.github.com/stucchio/7447067 but accounting for death rates, as suggested by a commenter on the blog.
from pylab import *
from scipy.stats import *
num_adults = 227e6
basic_income = 7.25*40*50
labor_force = 154e6
disabled_adults = 21e6
current_wealth_transfers = 3369e9
def jk_rowling(num_non_workers):
@stucchio
stucchio / basic_income_monte_carlo.py
Last active August 28, 2021 01:42
Monte carlo simulation of basic income/basic job calculations, from blog.
from pylab import *
from scipy.stats import *
num_adults = 227e6
basic_income = 7.25*40*50
labor_force = 154e6
disabled_adults = 21e6
current_wealth_transfers = 3369e9
def jk_rowling(num_non_workers):
@dupuy
dupuy / README.rst
Last active April 23, 2024 23:38
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.