Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tony's full-sized avatar
💭
I may be slow to respond.

Tony Narlock tony

💭
I may be slow to respond.
View GitHub Profile
@tony
tony / useEventCallback.ts
Created September 9, 2019 01:30
LICENSE MIT
import React from 'react'
export const useEventCallback = <T extends (...args: any[]) => any>(
callback: T,
dependencies: React.DependencyList,
) => {
const ref = React.useRef(() => {
throw new Error('Cannot call an event handler while rendering.')
})
@tony
tony / cihai-corporate-cla.txt
Created April 21, 2018 13:44
Cihai Foundation Software Grant and Corporate Contributor License Agreement ("Agreement"), v1.0
Cihai Foundation Software Grant and Corporate Contributor License Agreement
("Agreement"), v1.0
You accept and agree to the following terms and conditions for Your present and
future Contributions submitted to Cihai Software Foundation. ("Cihai"). Except
for the license granted herein to Cihai and recipients of software distributed
by Cihai, You reserve all right, title, and interest in and to Your
Contributions.
1. Definitions.
@tony
tony / cihai-individual-cla.txt
Last active April 21, 2018 13:40
Cihai Software Foundation Individual Contributor License Agreement ("Agreement"), v1.0
Cihai Software Foundation Individual Contributor License Agreement
("Agreement"), v1.0
You accept and agree to the following terms and conditions for Your present and
future Contributions submitted to Cihai Software Foundation. ("Cihai"). Except
for the license granted herein to Cihai and recipients of software distributed
by Cihai, You reserve all right, title, and interest in and to Your
Contributions.
1. Definitions.
@tony
tony / flask_pdb.py
Created April 2, 2018 21:38 — forked from alonho/flask_pdb.py
Flask: drop into pdb on exception
def drop_into_pdb(app, exception):
import sys
import pdb
import traceback
traceback.print_exc()
pdb.post_mortem(sys.exc_info()[2])
# somewhere in your code (probably if DEBUG is True)
flask.got_request_exception.connect(drop_into_pdb)
@tony
tony / bs4-border-radius-mixin.scss
Created August 28, 2017 14:48
card columns behavior for bulma
// Single side border-radius
@mixin border-radius($radius: $border-radius) {
@if $enable-rounded {
border-radius: $radius;
}
}
@mixin border-top-radius($radius) {
@if $enable-rounded {
@tony
tony / create_datapackage.py
Created May 13, 2017 00:33
create datapackage for unihan-tabular
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Based off http://frictionlessdata.io/guides/creating-tabular-data-packages-in-python/
For use on https://github.com/cihai/unihan-tabular
License: MIT
"""
from __future__ import (absolute_import, division, print_function,
@tony
tony / examples.md
Last active August 3, 2016 04:13
oxygine repo restructure

clone oxygine

❯ git clone https://github.com/oxygine/oxygine-framework oxygine

separate examples into oxygine-examples repo

add remote to new repo

@tony
tony / hi2.c
Created June 15, 2016 05:41
what's the story with AS_CFI_PSEUDO_OP tests
#include <stdio.h>
// run: clang -S hi2.c
int main(){
printf("HI");
}
@tony
tony / arch-linux-install
Created December 29, 2015 05:24 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@tony
tony / fabfile.py
Last active July 4, 2018 08:22
Can saltstack states and modules play with pure python / fabric? https://github.com/saltstack/salt/issues/22842
# -*- coding: utf-8 -*-
"""Proof of concept to use saltstack's pure modules and states with fabric::
fab list_packages print_specs -H <ip> --user=<user>
On my vagrant environment:
fab list_packages print_specs -H <ip> --password=vagrant --user=vagrant
"""