Skip to content

Instantly share code, notes, and snippets.

View thangngoc89's full-sized avatar

Khoa Nguyen thangngoc89

View GitHub Profile
@remino
remino / msconvert.js
Created January 5, 2012 05:37
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
function convertMS(ms) {
var d, h, m, s;
s = Math.floor(ms / 1000);
m = Math.floor(s / 60);
s = s % 60;
h = Math.floor(m / 60);
m = m % 60;
d = Math.floor(h / 24);
h = h % 24;
return { d: d, h: h, m: m, s: s };
@max-mapper
max-mapper / readme.md
Last active April 28, 2019 03:55
trie implementations on npm

a trie (aka prefix trie) is a way of storing string values such that for an input string (e.g. autocomplete) all matching stored values can be re__trie__ved efficiently

listed alphabetically:

  • burst-trie - burst trie implementation, seems to be written in a Java style, no readme, not sure how fast it is
  • datrie - double array trie - a trie that uses arrays instead of objects for faster + smaller serialization
  • dtrie - trie based on minimal automaton, has stress tests, API is coupled to node though (requires fs)
  • glob-trie - trie with pattern matching expressions like * ? \ etc, has stress tests
  • iptrie - radix/patricia trie implementation specifically for IPv4 and IPv6 addresses
  • [marisa-trie](https://code.google.com/p/mari
@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
@ungoldman
ungoldman / dokku_setup.md
Last active November 28, 2023 12:35
Deploy your own PaaS: Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.


This write-up is several years out of date! You probably shouldn't use it.

#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live
@nikcorg
nikcorg / berlin-jsconf-2014.md
Last active August 4, 2023 12:45
Slide decks of JSConf 2014
@coderberry
coderberry / MaskedTextField.jsx
Last active May 27, 2017 18:18
MaskedTextField with material-ui
/** @jsx React.DOM */
var React = require('react')
, mui = require('material-ui')
, { TextField } = mui
, $ = require('jquery');
require('jquery.inputmask');
var MaskedTextField = React.createClass({
@chapel
chapel / About.md
Last active October 15, 2016 15:15
Discourse topic list customizations for http://discourse.wastingyourlife.co
@ryanmcgrath
ryanmcgrath / example.js
Last active January 23, 2021 09:42
A basic React Video tag. I wanted to use video.js inside something I was building, so this is more or less a 5-minute tag for handling it. ES6 syntax but you can extrapolate what you need. Handles dynamically loading video.js/css as necessary since I really loathe serving any swf/etc myself. Could be easily extended or made better, works for me …
import React from 'react';
import Video from './Video';
class MyGenericApp extends React.Component {
render() {
return <div>
<Video src="my_video_url" poster="my_poster_url" />
</div>;
}
}
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')