Skip to content

Instantly share code, notes, and snippets.

@anson-vandoren
anson-vandoren / karma.config.js
Created July 23, 2015 10:35
Configuration to finally get Karma working with RequireJS. After Karma is installed, run `karma start karma.config.js`
// Karma configuration
// Generated on Wed Jul 22 2015 18:41:14 GMT+0900 (Tokyo Standard Time)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
@anson-vandoren
anson-vandoren / GetSmallCapsString.java
Created January 22, 2016 18:56 — forked from markormesher/GetSmallCapsString.java
Create a small-caps spannable string that will work with any font
/**
* Produce a formatted SpannableString object from a given String
* input, with all lowercase characters converted to smallcap
* characters. Uses only standard A-Z characters, so works with
* any font.
*
* @param input The input string, e.g. "Small Caps"
* @return A formatted SpannableString, e.g. "Sᴍᴀʟʟ Cᴀᴘs"
*/
public static SpannableString getSmallCapsString(String input) {
#NoEnv
#Warn
#SingleInstance force
SendMode Input
; Use Command-Space to pin a window on top
#Space:: Winset, Alwaysontop, , A
Return
; Change control-W to control-F4
@anson-vandoren
anson-vandoren / telegram_notification.sh
Created February 28, 2019 17:58
Travis-Telegram notification script
#!/bin/sh
##########################################################################
# Note: you must have set up your Travis CI environment variables for this
# project to include both TELEGRAM_TOKEN and TELEGRAM_CHAT_ID
# For more details, see the Telegram documentation at:
# - https://core.telegram.org/bots/api
# and the blog posts at:
# - https://ansonvandoren.com/posts/telegram-notification-on-deploy/
# - https://ansonvandoren.com/posts/travis-telegram-integration/
@anson-vandoren
anson-vandoren / interview_solutions.py
Created March 9, 2019 17:10
Interview solutions (naive, no StackOverflow)
#######
# One #
#######
import re
def longest_prefix(str_list):
sorted_strs = sorted(str_list, key=lambda x: len(x))
longest = sorted_strs[-1]
@anson-vandoren
anson-vandoren / README.md
Last active April 6, 2022 05:10
Flask-RESTPlus with Nginx reverse proxy on Docker

This setup does not require the "Flask snippet #35" solution that is most often given for flask-restplus answers to this question.

Using the "snippet 35" solution means that the "Try it!" commands from the SwaggerUI display the wrong endpoint, which adds confusion to others looking at your documentation.

@anson-vandoren
anson-vandoren / docker-compose.yml
Created May 21, 2019 01:25
Drone.io (v1.0) docker-compose
version: '3.7'
services:
drone-server:
container_name: drone_server
image: drone/drone:1
ports:
- 8080:80
volumes:
- /var/lib/drone:/data
@anson-vandoren
anson-vandoren / .drone.yml
Created May 21, 2019 02:05
Sample .drone.yml configuration file
---
################
# Build & Test #
################
kind: pipeline
name: run_tests
steps:
# Run tests against React client app (with Jest)
@anson-vandoren
anson-vandoren / pygame_chromebook.md
Last active February 11, 2021 22:48
Installing Pygame on ARM chromebook (Samsung Chromebook 2)
  1. Install Linux (crostini)
  2. Update package manager lists
$ sudo apt-get update
  1. Install python3
$ sudo apt-get install python3 python3-pip
  1. Install dependencies

Keybase proof

I hereby claim:

  • I am anson-vandoren on github.
  • I am ansonvandoren (https://keybase.io/ansonvandoren) on keybase.
  • I have a public key whose fingerprint is 86A6 C0BC 74C3 0D71 BE11 C590 2D1D A511 8D1B C5BD

To claim this, I am signing this object: