Skip to content

Instantly share code, notes, and snippets.

View kageurufu's full-sized avatar
🏠
Working from home

Frank Tackitt kageurufu

🏠
Working from home
View GitHub Profile
################################################################################
################# Arch Linux mirrorlist generated by Reflector #################
################################################################################
# With: reflector -c US -a 16 -f 15 --save /etc/pacman.d/mirrorlist
# When: 2015-11-30 21:13:56 UTC
# From: https://www.archlinux.org/mirrors/status/json/
# Retrieved: 2015-11-30 21:13:24 UTC
# Last Check: 2015-11-30 20:59:33 UTC
##
## Arch Linux repository mirrorlist
## Generated on 2016-02-27
##
## Any commented mirrors are returning a HTTP 404 for multilib.db
## and should not be used.
##
## Worldwide
Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch
$ arch-nspawn $CHROOT/root pacman -S gedit
resolving dependencies...
:: There are 4 providers available for libgl:
:: Repository extra
1) mesa-libgl 2) nvidia-304xx-libgl 3) nvidia-340xx-libgl 4) nvidia-libgl
Enter a number (default=1):
looking for conflicting packages...
warning: dependency cycle detected:
warning: harfbuzz will be installed before its freetype2 dependency
from flask import Flask, render_template_string, jsonify
from flask.ext.login import LoginManager, UserMixin, current_user
class User(UserMixin):
def __init__(self, token, email):
self.id = email
self.token = token
USERS = {'1': User('1', '[email protected]'),
'2': User('2', '[email protected]'),
from . import app, db
class Drink(db.Model):
__tablename__ = 'drink'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), index=True, unique=True)
recipe = db.relationship("DrinkIngredient", backref="drink")
def __init__(self, name):
export default {
RpcDirection: {
UNKNOWN: 0, 0: "UNKNOWN",
RESPONSE: 1, 1: "RESPONSE",
REQUEST: 2, 2: "REQUEST",
},
TeamColor: {
NEUTRAL: 0, 0: "NEUTRAL",
BLUE: 1, 1: "BLUE",
import os
from flask import Flask, request
from io import BufferedReader
import magic
app = Flask(__name__)
@app.route("/<string:filename>", methods=['PUT'])
def upload(filename):
head = request.stream.read(1024)
@kageurufu
kageurufu / MainApplication.java
Created August 17, 2016 20:11
Fix for react-native#9319
// Add the following imports and methods in their respective places
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.LifecycleState;
public class MainApplication extends Application implements ReactApplication {
protected Application getApplication() { return this; }
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
"""
html_to_text
Parses and converts HTML to plain text with formatting to match the original intention
For example, the following HTML would be converted as follows
<html>
<head>
<style>
@kageurufu
kageurufu / LICENSE
Last active October 21, 2016 19:04
Postgresql natural sorting using plv8
Copyright (c) 2016 Franklyn Tackitt
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE