Skip to content

Instantly share code, notes, and snippets.

View kaungmyatlwin's full-sized avatar

Kaung Myat Lwin kaungmyatlwin

View GitHub Profile

How to create HTTPS dev envronment in Linux

Update

If you want to generate certificates manually follow up to the Create Certificate with OpenSSL in the next section. This is more recommended way of doing since you don't have to do the manual labour and free from the risk of human error.

The solution is using auto-generate tool called mkcert. It is written in go and work perfectly fine on almost every OS with super easy commands.

@eimg
eimg / moment.my-mm.locale.js
Created August 6, 2017 07:56
Burmese locale for Moment.js
moment.locale('my-mm', {
months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
monthsShort: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
monthsParseExact: true,
weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသာပတေး_သောကြာ_စနေ'.split('_'),
weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_တေး_ကြာ_နေ'.split('_'),
weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_တေး_ကြာ_နေ'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
@nhagen
nhagen / PromisAllWithFails.js
Last active November 15, 2022 18:11
Wait until all promises have completed even when some reject, with Promise.all
var a = ["sdfdf", "http://oooooolol"],
handleNetErr = function(e) { return e };
Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr))
.then(function(sdf, invalid) {
console.log(sdf, invalid) // [Response, TypeError]
})
.catch(function(err) {
console.log(err);
})
@Swivelgames
Swivelgames / carousel-example.css
Created March 1, 2015 04:46
Simple JavaScript Carousel
@staltz
staltz / introrx.md
Last active May 2, 2024 12:31
The introduction to Reactive Programming you've been missing
@katowulf
katowulf / 1_query_timestamp.js
Last active September 21, 2023 20:28
Get only new items from Firebase
// assumes you add a timestamp field to each record (see Firebase.ServerValue.TIMESTAMP)
// pros: fast and done server-side (less bandwidth, faster response), simple
// cons: a few bytes on each record for the timestamp
var ref = new Firebase(...);
ref.orderByChild('timestamp').startAt(Date.now()).on('child_added', function(snapshot) {
console.log('new record', snap.key());
});