Skip to content

Instantly share code, notes, and snippets.

View namtx's full-sized avatar
🐤
Fullstuck developer

0x6e616d7478 namtx

🐤
Fullstuck developer
View GitHub Profile

\nHow Nike Run Club led me to write my first AI project\n\n\n\n\nFor a long time I’ve wanted to start learning how to use AI as part of my code flow. Whereshould I start? Well, I don’t have B.Sc and definitely don’t have the math fundamentals to understand all the equations and calculations behind it. But then, I have came across this amazing article of Jason Brownlee and I’ve started believing again!\n\nAfter reading many times this article and understanding it I can finally tell that I’m fluency with KNN algorithm. Let’s talk about KNN a bit.\n\n# KNN Algorithm\n\nImagine you are in the World Cup. You see three pubs of different fans: England, Sweden and France. You are welsh, whom would you celebrate with? of course England because you are both in Great Britain!\n\nThat is the meaning of KNN: K Nearest Neighbors. \nOur data will be classified to the nearest type in the same dimension:\n

@namtx
namtx / init.el
Last active August 10, 2018 10:29
emacs config
;; Minimal UI
(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)
(menu-bar-mode -1)
(add-to-list 'default-frame-alist '(font . "Inconsolata Bold"))
(add-to-list 'default-frame-alist '(height . 24))
(add-to-list 'default-frame-alist '(width . 80))
greet = function(person) {
switch(person,
Nick = {
# fast and smart
Sys.sleep(3); 'Hello!'
},
Yihui = {
# slow and shy
Sys.sleep(15); '你好!'
}
@namtx
namtx / package.json
Created September 7, 2018 08:40
Typescript with Webpack
{
"name": "ts-playground",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"run": "webpack --mode development --display none && node dist/bundle.js",
"start": "webpack --mode development",
"build": "webpack --mode production"
},
package main
import (
"fmt"
"sort"
)
func main() {
A := []int{32, 38, 8, 1, 9}
B := []int{68, 92}
package main
import (
"fmt"
)
func main() {
str := "hello"
for _, c := range str {
fmt.Println(c)
package main
import (
"fmt"
)
func main() {
s := "leetcode"
fmt.Println(firstUniqChar(s))
}
func binaryGap(N int) int {
count := 0
max := 0
isPreviousOne := false
for N > 0 {
// fmt.Println(N % 2)
if N%2 == 1 {
if count > max {
max = count
}
package main
import (
"fmt"
)
func main() {
nums := []int{2, 7, 11, 15}
target := 9
fmt.Println(twoSum(nums, target)) // [1, 2]
@namtx
namtx / cfdesigner.json
Created October 3, 2018 07:45
CloudFormation Lab
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"7b463913-5e19-4c74-898a-2220105ccd41": {
"size": {
"width": 60,
"height": 60
},
"position": {