Skip to content

Instantly share code, notes, and snippets.

View xgenvn's full-sized avatar

TuNA xgenvn

View GitHub Profile
@xgenvn
xgenvn / micropython-html-slides.py
Created November 1, 2016 02:19 — forked from turbinenreiter/micropython-html-slides.py
a small presentation about MicroPython including a 'webserver' to serve it from a microcontroller
import socket, machine
# This is the HTML, CSS and js to deliver to the client.
# You can (should) store this in another file and read from there,
# but I am lazy.
# The CSS and HTML to display pretty code is from pygments.
upy = """<!DOCTYPE html>
<html>
<head>
<title>I'm a website running on a Microcontroller.</title>
@xgenvn
xgenvn / serialplot2
Created November 1, 2016 02:19 — forked from turbinenreiter/serialplot2
plotting data from serial port with matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import serial
fig, ax = plt.subplots()
line, = ax.plot(np.random.rand(10))
ax.set_ylim(-5000, 5000)
xdata, ydata = [0]*100, [0]*100
raw = serial.Serial("/dev/ttyUSB1",9600)
@xgenvn
xgenvn / clink.lua
Last active November 23, 2016 02:03
Support conda env on cmder prompt and some custom lamb chars
# Single line comments start with a number symbol.
""" Multiline strings can be written
using three "s, and are often used
as comments
"""
####################################################
## 1. Primitive Datatypes and Operators
####################################################
@xgenvn
xgenvn / _vimrc
Last active December 22, 2016 17:22 — forked from aburok/_vimrc
Vim common configuration for GVim and VsVim
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" Vim ESCAPE Combinations{{{
imap jj <esc>
imap <S-Space> <Esc>
vnoremap <S-Space> <Esc>
" }}}
@xgenvn
xgenvn / py3.5_ubuntu_14.04.txt
Created December 24, 2016 10:56 — forked from larainema/py3.5_ubuntu_14.04.txt
how to install python3.5 on ubuntu 14.04
Felix Krull runs a PPA offering basically any version of Python (seriously, there is 2.3.7 build for vivid...) for many Ubuntu releases at
https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes
Do the usual:
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python3.5
It will not overwrite your existing python3.4 which is still symlinked as python3. If you want python3.5 to be the default python3, change the symlink
@xgenvn
xgenvn / ignorerules.txt
Created December 27, 2016 02:45 — forked from ChrisMcKee/ignorerules.txt
Tortoise SVN Visual Studio Ignore Rules
Applied on svn properties (recursively) using svn:ignore .
build.txt
*.resharper
**.ReSharper**
*.suo
*.user
*.pdb
;; CREATE A KEYSTORE
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
;; SIGN the APK
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore app.apk alias_name
Or
jarsigner -verbose -keystore PATH/TO/YOUR_RELEASE_KEY.keystore -storepass YOUR_STORE_PASS -keypass YOUR_UNSIGNED_PROJECT.apk YOUR_ALIAS_NAME
@xgenvn
xgenvn / actionlist.vim
Created February 24, 2017 15:35 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@xgenvn
xgenvn / StateMachine
Created February 24, 2017 15:41 — forked from elandau/StateMachine
Rx based state machine
package com.netflix.experiments.rx;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Observable.OnSubscribe;