Skip to content

Instantly share code, notes, and snippets.

@tungnk1993
tungnk1993 / cygwin npm command not found
Created May 21, 2020 03:57
Cygwin command not found after npm install
Scenario:
$ npm install -g abc
.....
$ abc
-bash: abc: command not found
Solution:
npm bin -g
Add the path to users environment varible
@tungnk1993
tungnk1993 / pebby_zmq4_windows_64bit
Last active November 28, 2018 11:30
Install pebby zmq4 on windows 64-bit
1. Install http://zeromq.org/distro:microsoft-windows, choose 64-bit version
2. Install https://sourceforge.net/projects/mingw-w64/
a. Choose Version = 8.1.0
b. Choose Architecture = x86_64
3. Add mingw64 to path
4. Open cmd, test gcc
5. Steps:
a. Copy C:\Program Files\ZeroMQ 4.0.4\include\zmq.h
b. Copy C:\Program Files\ZeroMQ 4.0.4\include\zmq_utils.h
to C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\lib\gcc\x86_64-w64-mingw32\8.1.0\include
@tungnk1993
tungnk1993 / 0_reuse_code.js
Created March 21, 2017 12:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tungnk1993
tungnk1993 / nhk-news-easy-print.js
Last active January 24, 2017 05:48
Extract a print-ready news article from NHK News Easy
// open article with chrome, press f12, paste this code into console
$(function() {
var A4_HEIGHT = 975;
var save = $('#mainTop').detach();
$('body').empty().append(save);
$('.pagemove').remove();
$('#regularnews').remove();
$('#soundkana').remove();
$('body').css('background-image', 'none');
@tungnk1993
tungnk1993 / Budget Friendly.cpp
Last active December 6, 2015 09:12
[HackerRank] Booking Hackathon 2015
#include <iostream>
#include <string>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <deque>
#include <algorithm>
#include <list>
#include <map>
#include <set>
@tungnk1993
tungnk1993 / gist:802f62e8478ef8df49be
Created November 13, 2015 16:05 — forked from crizCraig/gist:2816295
Download images from Google Image search using Python
import json
import os
import time
import requests
from PIL import Image
from StringIO import StringIO
from requests.exceptions import ConnectionError
def go(query, path):
"""Download full size images from Google image search.
@tungnk1993
tungnk1993 / chart.js
Last active December 11, 2015 11:53
Fallout 4 Daily Steam Rating
$(function () {
var c = [];
var d = [];
var my_chart = [];
var options = {
chart: {
renderTo: 'container',
defaultSeriesType: 'line'
},
@tungnk1993
tungnk1993 / README.md
Last active January 25, 2016 15:48
[Curve] Directed / Weighted
  • Click on empty space to add node
  • Drag from node to node to add edge
  • Click/Select + Delete to delete node/edge
  • Click/Select Edge + Enter to change edge's weight
  • Press Ctrl to Drag node around
@tungnk1993
tungnk1993 / README.md
Last active December 23, 2015 09:44
[Parallel] Directed / Weighted
  • Click on empty space to add node
  • Drag from node to node to add edge
  • Click/Select + Delete to delete node/edge
  • Click/Select Edge + Enter to change edge's weight
  • Press Ctrl to Drag node around
@tungnk1993
tungnk1993 / README.md
Created June 18, 2014 18:06
[JSON] Undirected / Unweighted
  • Click on empty space to add node
  • Drag from node to node to add edge
  • Click + Delete to delete node/edge -Press Ctrl to Drag node around