Skip to content

Instantly share code, notes, and snippets.

Tony Narlock tony

Block or report user

Report or block tony

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View useEventCallback.ts
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 Apr 21, 2018
Cihai Foundation Software Grant and Corporate Contributor License Agreement ("Agreement"), v1.0
View cihai-corporate-cla.txt
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 Apr 21, 2018
Cihai Software Foundation Individual Contributor License Agreement ("Agreement"), v1.0
View cihai-individual-cla.txt
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 Apr 2, 2018 — forked from alonho/flask_pdb.py
Flask: drop into pdb on exception
View flask_pdb.py
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 Aug 28, 2017
card columns behavior for bulma
View bs4-border-radius-mixin.scss
// 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
create datapackage for unihan-tabular
View create_datapackage.py
#!/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 Aug 3, 2016
oxygine repo restructure
View examples.md

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 Jun 15, 2016
what's the story with AS_CFI_PSEUDO_OP tests
View hi2.c
#include <stdio.h>
// run: clang -S hi2.c
int main(){
printf("HI");
}
@tony
tony / arch-linux-install
Created Dec 29, 2015 — 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
View arch-linux-install
# 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 Jul 4, 2018
Can saltstack states and modules play with pure python / fabric? https://github.com/saltstack/salt/issues/22842
View fabfile.py
# -*- 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
"""
You can’t perform that action at this time.