Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Typing...

Spencer Bliven sbliven

💻
Typing...
View GitHub Profile
@Dan-Q
Dan-Q / google-authenticator.rb
Last active Mar 8, 2019
Command-line Google Authenticator (TOTP)
View google-authenticator.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
# encoding: utf-8
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rotp'
gem 'thor'
end
@msepcot
msepcot / TheFatedSky.rb
Created Dec 7, 2018
The Fated Sky: A Lady Astronaut Novel, Chapter 16 cypher text.
View TheFatedSky.rb
PLAINTEXT = %w(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
CRYPTTEXT = %w(E L P H A N T B C D F G I J K M O Q R S U V W X Y Z)
input = "Cj qarmkjra sk ykuq gers gassaq, C ei waeqcjt iy ngctbs rucs lus hk jks beva e lqe kj. Cn yku waqa baqa, C wkugh sefa yku cjsk sba teqhaj ikhuga ejh gaej kvaq sba skiesk lahr rk sbes er yku skkf ia nqki labcjh, iy nepa wkugh la mqarrah cjsk sba nqetqejs tqaaj gaevar wcsb aepb sbqurs.".upcase
input.split("").each do |character|
if position = CRYPTTEXT.find_index(character)
print PLAINTEXT[position]
else
print character
View wmfix
#!/usr/bin/python
#You may have to change some of these values to match display/dock/menubar sizes
xscr=1920
yscr=1080
yd=5
xd=80
xstart=0
ystart=44
xmax=xscr-xd
@nolanlawson
nolanlawson / protips.js
Last active Oct 19, 2020
Promise protips - stuff I wish I had known when I started with Promises
View protips.js
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@michaelxor
michaelxor / pymordial.sh
Last active Jan 10, 2017
A clean virtualenv with pip and setuptools (formerly distribute). Only requirement is a local python install. Adapted from http://stackoverflow.com/a/5177027
View pymordial.sh
# Name your first "bootstrap" environment:
INITIAL_ENV=pymordial
# Options for your first environment:
ENV_OPTS=''
# Set to whatever python interpreter you want for your first environment:
PYTHON=$(type -P python)
# Latest virtualenv from pypa
@dupuy
dupuy / README.rst
Last active Oct 5, 2020
Common markup for Markdown and reStructuredText
View README.rst

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.

You can’t perform that action at this time.