Skip to content

Instantly share code, notes, and snippets.

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

Nutchanon Ninyawee wasdee

🏠
Working from home
View GitHub Profile
@wasdee
wasdee / Exclude_tables.md
Last active November 21, 2020 07:36 — forked from utek/Exclude_tables.md
Define ignored tables in alembic.ini

Add this in your ini file:

[alembic]
exclude_tables =
  spatial_ref_sys,
  foo, bar

In env.py:

def get_list_from_config(config, key):

@wasdee
wasdee / fb_helpers.py
Created October 6, 2020 07:28 — forked from adrienjoly/fb_helpers.py
facebook signed_request parsing in python
import base64
import hashlib
import hmac
import simplejson as json
def base64_url_decode(inp):
padding_factor = (4 - len(inp) % 4) % 4
inp += "="*padding_factor
return base64.b64decode(unicode(inp).translate(dict(zip(map(ord, u'-_'), u'+/'))))
@wasdee
wasdee / .leptonrc
Last active September 8, 2018 22:51 — forked from hackjutsu/.leptonrc
[Template for .leptonrc] This is a template for Lepton's configuration file. Please place it on your home directory. #lepton
{
"snippet": {
"expanded": true,
"newSnippetPrivate": false,
"sorting": "updated_at",
"sortingReverse": true
},
"editor" : {
"tabSize": 4
@wasdee
wasdee / nvvp.md
Last active September 8, 2018 22:17 — forked from sonots/nvvp.md
How to use NVIDIA profiler #cuda

Usually, located at /usr/local/cuda/bin

Non-Visual Profiler

$ nvprof python train_mnist.py

I prefer to use --print-gpu-trace.

@wasdee
wasdee / build_tf.sh
Last active September 8, 2018 22:13 — forked from venik/build_tf.sh
Bash script for [local building TensorFlow on Mac with all CPU optimizations] (default pip package has only SSE) #setup
#!/bin/bash
# Author: Sasha Nikiforov
# source of inspiration
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions
# check if VirtuelEnv activated
if [ -z "$VIRTUAL_ENV" ]; then
echo "VirtualEnv is not activated"
@wasdee
wasdee / brew-perms.sh
Last active September 8, 2018 22:17 — forked from jaibeee/brew-perms.sh
[Configure homebrew permissions to allow multiple users] on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine. #macOS #setup #homebrew
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@wasdee
wasdee / bash-cheatsheet.sh
Created June 23, 2017 05:01 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@wasdee
wasdee / selectfile.py
Created June 20, 2017 06:16 — forked from DrDub/selectfile.py
A file selection class build for ipywidgets without any extra dependencies.
import os
import ipywidgets as widgets
class FileBrowser(object):
def __init__(self):
self.path = os.getcwd()
self._update_files()
@wasdee
wasdee / bobp-python.md
Last active September 8, 2018 22:17 — forked from sloria/bobp-python.md
A "[Best of the Best Practices]" (BOBP) guide to developing in Python. #python

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens