Instantly share code, notes, and snippets.

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:

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
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
<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>
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
View octohat.rb
# Super basic implementation of the octohat concept, but in ruby.
# It most probably is missing some elements.
require 'octokit'
access_token = ENV["GITHUB_TOKEN"]
repo = ARGV[0]
client = Octokit::Client.new(:access_token => access_token)
Octokit.auto_paginate = true
View gist:f9478fc8bf8269d8426d

DEVOPS WEEKLY ISSUE #230 - 31st May 2015

A bit of a monitoring/performance/security feel this week - mainly due to Velocity conference this last week and partly as I’m heading to Infosecurity Europe this coming week. Thanks to folks who sent me infrastructure testing links last week too.

Sponsor

Devops Weekly is sponsored by Brightbox Cloud - serious UK-based cloud infrastructure from only 1.5p per hour (£10.95/month)

View 00_readme.md

Rubocop doesn't appear to be correcting spaces within braces denoting variables within strings.

Attempting an automatic correction does not fix this.

Running the auto-gen-correct command does not suggest any configurations to correct this.