Skip to content

Instantly share code, notes, and snippets.

View gordol's full-sized avatar

Gordo Lowrey gordol

View GitHub Profile
@Sunlighter
Sunlighter / README.md
Last active November 12, 2022 11:21
Installing .NET 5 in Amazon Linux 2 for ARM

Installing .NET 5 in Amazon Linux 2 for ARM64

This is a way to install .NET 5 in your home directory without modifying the system.

At the time of this writing, Amazon Linux 2 for ARM64 almost works already, but there is a problem with the ICU library. I will show this problem and how to fix it.

  1. Start Amazon Linux 2 and sign in. (I recommend an m6g.medium instance
@breeko
breeko / CaseClass.py
Last active March 22, 2021 21:54
Scala's case class built out for Python
def CaseClass(case_class_name, **kwargs):
types = {}
for k, v in kwargs.items():
if type(v) is not type:
raise ValueError("{} is not a type".format(v))
types[k] = v
class CaseClassImpl():
initialized = False
@woodrow
woodrow / onc_converter.py
Created April 27, 2016 23:54
Convert OpenVPN config files to ChromeOS ONC files
import argparse
import json
import re
import sys
import uuid
class OpenVPNNetworkConfiguration(object):
KNOWN_CONFIG_KEYS = {
'name': {'key': 'Name'},
@jmhdez
jmhdez / ko-chart.js
Last active February 11, 2019 15:32
Custom bindings to use Chart.js with Knockout.js
/*global ko, Chart */
(function(ko, Chart) {
ko.bindingHandlers.chartType = {
init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
if (!allBindings.has('chartData')) {
throw Error('chartType must be used in conjunction with chartData and (optionally) chartOptions');
}
},
@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active September 24, 2024 14:47
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
@akhenakh
akhenakh / slow_server.py
Created June 26, 2012 13:00
An async slow testing server
# pip install tornado then just launch it with python slow_server.py --port=8080
# then call http://localhost:8080/wait/600 for a 600ms request
# Fabrice Aneche https://gist.github.com/2995678
import tornado.web
import tornado.httpserver
import time
import logging
from tornado.options import define, options