Skip to content

Instantly share code, notes, and snippets.

🦜

Katie McLaughlin glasnt

Block or report user

Report or block glasnt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@glasnt
glasnt / Code.gs
Created Dec 10, 2018 — forked from rheajt/Code.gs
google apps script to open a new website in a new window
View Code.gs
function openTab() {
var selection = SpreadsheetApp.getActiveSheet().getActiveCell().getValue();
var html = "<script>window.open('" + selection + "');google.script.host.close();</script>";
var userInterface = HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Open Tab');
}
View keybase.md

Keybase proof

I hereby claim:

  • I am glasnt on github.
  • I am glasnt_ (https://keybase.io/glasnt_) on keybase.
  • I have a public key whose fingerprint is F026 9B50 5233 B0C9 8D1E 037C CA63 6DA6 7DA9 A6F6

To claim this, I am signing this object:

@glasnt
glasnt / glitchulate.py
Created Nov 15, 2016 — forked from hawkowl/glitchulate.py
Make your favourite images into glitched monstrosities! (Requires pillow from PyPI, Py2/3/pypy compatible)
View glitchulate.py
from __future__ import print_function
import sys
import random
from collections import deque
from PIL import Image
# THIS IS THE MAGIC VALUE THAT MAKES EVERYTHING GLITCHED
@glasnt
glasnt / regional.py
Last active Aug 25, 2016
🇷​🇪​🇬​🇮​🇴​🇳​🇦​🇱​ ​🇮​🇳​🇩​🇮​🇨​🇦​🇹​🇴​🇷​ ​🇨​🇭​🇦​🇷​🇦​🇨​🇹​🇪​🇷​🇸​ ​🇦​🇸​ ​🇦​ ​🇸​🇪​🇷​🇻​🇮​🇨​🇪
View regional.py
"""
Usage: python3 regional.py list of words
Prints a representation of the words as Regional Identifiers, and copies the output directly to keyboard for you
This is because some terminals think that zero width spaces are silly.
Currently supports: A-Z
Requires: Python 3
Now less complex, thanks @bmispelon!
"""
View index.html
<!doctype html>
<script src="https://code.shutterstock.com/rickshaw/vendor/d3.v2.js"></script>
<script src="https://code.shutterstock.com/rickshaw/rickshaw.min.js"></script>
<div id="chart"></div>
<script>
// Return an xinterp function for a given graph
function xinterp_on_graph(graph) {
View index.html
<div style="font-family: Monaco">
Monaco<br>
<table><tr><td>▁ ▂ ▃ ▅ ▆ ▇</td><td>▁▂▃▅▆▇</td></tr>
<tr><td>▁▂▃▄▅▆▇█</td><td>▁▂▃▄▅▆▇█</td></tr></table>
</div>
<div style="font-family: Menlo">
Menlo
<table><tr><td>▁ ▂ ▃ ▅ ▆ ▇</td><td>▁▂▃▅▆▇</td></tr>
@glasnt
glasnt / pastie
Created Sep 10, 2013
Given sufficient s3cmd setup, this script can be used to paste stuff into your bucket.
View pastie
#! /bin/bash -e
BUCKET="mabucket"
PASTE="paste"
if [ $# -eq 0 ]; then echo "Usage: $0 filename, or -l for list"; exit 1;fi
if [ $1 = "-l" ]; then s3cmd ls s3://$BUCKET/$PASTE/; exit 0; fi
FILENAME=`date +"%s"`
cp $1 /tmp/$FILENAME.txt
@glasnt
glasnt / ncpus.py
Created Dec 15, 2015
Get Number of CPUs for Any System, if Python is about
View ncpus.py
# Based on : https://groups.google.com/d/msg/sage-devel/1lIJ961gV_w/y-2uqPCyzUMJ
import os
def ncpus():
#for Linux, Unix and MacOS
if hasattr(os, "sysconf"):
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
#Linux and Unix
ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
if isinstance(ncpus, int) and ncpus > 0:
return ncpus
You can’t perform that action at this time.