Skip to content

Instantly share code, notes, and snippets.

View tandat2209's full-sized avatar
🏆

Tan Dat tandat2209

🏆
View GitHub Profile
@tandat2209
tandat2209 / gadm36_VNM_0.json
Last active July 20, 2023 13:18
Vietnam with Paracel Island and Spartly Island Topojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tandat2209
tandat2209 / canada.json
Created August 25, 2020 03:06
canada.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import React from 'react';
import ReactResizeDetector from 'react-resize-detector';
import PropTypes from 'prop-types';
import ReactTooltip from 'react-tooltip';
export default class OverflowTooltip extends React.Component {
constructor(props) {
super(props);
this.node = null;
this.onResize = this.onResize.bind(this);
@tandat2209
tandat2209 / proxy.pac
Last active March 8, 2019 04:37
Proxy.pac
function FindProxyForURL(url, host) {
switch (true) {
case shExpMatch(host, "localdev.*"):
return "PROXY localhost:3000";
case shExpMatch(host, "jp.*.jobing.com"):
return "PROXY localhost:3000";
@tandat2209
tandat2209 / tandat.zsh-theme
Last active April 16, 2019 07:39
tandat.zsh-theme
rvm_current() {
rvm current 2>/dev/null
}
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
}
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}$(shrink_path -l -t)%{$reset_color%} $(git_prompt_info)'
@tandat2209
tandat2209 / anagrams.js
Created November 8, 2016 09:34
Group Anagrams
function group(arr){
let result = [];
let j=0;
let tmp = arr;
while(tmp.length > 0){
let cmp = tmp[0];
result[j] = [];
for(let i=0; i<tmp.length;i++){
if(isAnagram(cmp, tmp[i])){
result[j].push(tmp[i]);
@tandat2209
tandat2209 / ClockAngle.java
Created October 14, 2016 01:49
Count angle made of hour hand and minute hand
package com.company;
/**
* Created by tandat on 10/14/16.
*/
public class ClockAngle {
public static void main(String[] args) {
System.out.println("Angle = " + countAngle(12, 15));
}
public static double countAngle(int h, int m){
var currentClick = 0;
var num = 1;
// list of all connected users
var users = [];
io.on('connection', function(socket){
var newUser = {
name: 'user'+(num++),
numOfClicks: 0
}
// add newUser
package matrixTCP;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Matrix {
private int rows;
private int cols;
private double[][] data;
@tandat2209
tandat2209 / BieuThuc.java
Last active May 10, 2016 04:09
Tính gần đúng phương trình
package giaipt;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import bai1_2.KyPhapBaLan;
public class BieuThuc {
private String bieuthuc = "";