Skip to content

Instantly share code, notes, and snippets.

@ndvo2710
ndvo2710 / .block
Last active April 28, 2017 12:16
VISUALIZATION OF PISA DATA
license: gpl-3.0
@ndvo2710
ndvo2710 / data.csv
Last active April 29, 2017 01:16
VIetnam GDP 1900-1970
Year Region GDP GDP_Per_Capita
1900 South 28.076 4.95
1901 South 29.943 5.14
1902 South 33.511 5.73
1903 South 26.026 4.42
1904 South 30.832 5.21
1905 South 27.77 4.66
1906 South 27.796 4.63
1907 South 35.819 5.92
1908 South 32.307 5.3
@ndvo2710
ndvo2710 / data.csv
Last active April 29, 2017 02:17
TOP 10 GOOGLE SALARIES 2012
Rank Job channel Salary
1 1 Lead Software Engineer Contractor Low 221000
2 2 Product Management Director Low 203000
3 3 Directors Low 172000
4 4 Engineering Director Low 184000
5 5 Human Resources Director Low 183000
6 6 Senior Partner Technology Manager Low 180000
7 7 Staff User Experience Designer Low 167000
8 8 Marketing Director Low 165000
9 9 Group Product Manager Low 157000
@ndvo2710
ndvo2710 / index.html
Created April 29, 2017 02:21
Two Bell Curves
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Two Bell Curves</title>
<meta name="description" content="">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style type="text/css">
@ndvo2710
ndvo2710 / app.py
Created March 15, 2018 08:09
Plotly-Dash
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div(children=[
html.H1(children='Hello Dash'),
@ndvo2710
ndvo2710 / MoveZipnExtract
Created March 15, 2018 08:35
py: File, Folder, Directory snippets
for elem in os.listdir(DOWNLOAD_DIR):
if elem.endswith('.zip'):
src = os.path.join(DOWNLOAD_DIR, elem)
dst = os.path.join(........)
shutil.move(src, dst)
time.sleep(20)
zipPath = os.path.join(dst, elem)
zip_ref = zipfile.ZipFile(zipPath, 'r')
@ndvo2710
ndvo2710 / import argparse
Created March 15, 2018 08:40
py:: argparse
parser = argparse.ArgumentParser()
parser.add_argument('build',
type=str,
help='GET WORKING INPUT NUMBER')
parser.add_argument('-d', '--download',
action='store_true',
help='DOWNLOAD BUILD')
parser.add_argument('-f', '--flash',
action='store_true',
help='FLASH BUILD')
@ndvo2710
ndvo2710 / IdleDrainTest.py
Last active March 20, 2018 08:35
Power Drain Test
import os
import sys
import time
import subprocess
import shlex
import re
def read_battery_level(device):
cmd = "adb -s " + device + " shell dumpsys battery| grep level"
@ndvo2710
ndvo2710 / 1) Introduction
Last active April 4, 2018 01:16
2) Optimizing Postgres Databases
A) Exploring Postgres Internal
B) Debugging Postgres Queries
C) Using an Index
D) Advanced Indexing
E) Vacuuming Postgres Databases
@ndvo2710
ndvo2710 / installApk
Last active September 20, 2018 22:43
Install Multiple APKs on multiple Android
import sys, os
import time
import shutil, zipfile
import subprocess, shlex
import argparse
import StringIO
HOME = os.getcwd()
def getAllDeviceIds():