Skip to content

Instantly share code, notes, and snippets.

View kosaikham's full-sized avatar

sai lao kham kosaikham

View GitHub Profile
@adamayd
adamayd / Podcasts2018.md
Created January 31, 2018 02:51
Web Development Podcasts for Beginners in 2018

Web Development Podcasts for Beginners in 2018

Commuting to work from east of Baltimore to Washington DC leaves a lot of time in the car. While driving to work one day early in my web development career, I wondered if there is such a thing as a web development podcast. How would you pull off live coding on a “radio” podcast. Well, you don’t. Well, sometimes they do, but the moral of the story is that I was shocked to find that not only are there web development podcasts, there are a lot of them and really good ones to boot. These podcasts have become staples to my learning and I recommend them to everyone who is just starting out. While there are plenty to listen to, I recommend starting with these. You’ll have plenty of time later to load up deep dives into the V8 JavaScript engine later.

Technology Podcasts

These podcasts are focused more on the technologies used in web development and their use cases.

Syntax - The new kid on the block and by far my favorite right now. Syn

@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@DianaEromosele
DianaEromosele / Change "origin" of your GIT repository
Created August 7, 2016 00:31
Change "origin" of your GIT repository
$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
@enginebai
enginebai / MainActivity.java
Last active July 27, 2021 11:10
Get the current location and display a marker on Google Map.
package com.enginebai.sample;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
@mkhatib
mkhatib / geo.js
Created May 24, 2013 02:55
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {