Skip to content

Instantly share code, notes, and snippets.

View congnd's full-sized avatar
🚀
🛡

Cong Nguyen congnd

🚀
🛡
View GitHub Profile
@congnd
congnd / README.md
Created April 4, 2017 00:42 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


# NPM
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean --force && npm install && npm start -- --reset-cache
# YARN
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean --force && yarn install && npm start -- --reset-cache
@congnd
congnd / tmux.md
Created October 27, 2019 06:11 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@congnd
congnd / GitLocalUser
Last active December 17, 2019 00:59
Force Git to ask you for your name/email in the first time you make commit for a new repository.
// Add the following lines into your ~/.gitconfig
[user]
name =
useConfigOnly = true
email =
@congnd
congnd / roman-to-integer.swift
Created February 21, 2020 00:17
Swift solution for roman-to-integer challenge: https://leetcode.com/problems/roman-to-integer
class Solution {
func romanToInt(_ s: String) -> Int {
var iterator = s.utf8CString.makeIterator()
var result: Int = 0
var current: RomanCharacter?
current = iterator.getNext()
while let unwrappedCurrent = current {
@congnd
congnd / is-subsequence.swift
Created February 21, 2020 00:19
Swift solution for is-subsequence challenge: https://leetcode.com/problems/is-subsequence
class Solution {
func isSubsequence(_ s: String, _ t: String) -> Bool {
let sub = Array(s.utf8)
let string = Array(t.utf8)
var subIndex: Int = 0
var stringIndex: Int = 0
while stringIndex < string.count, subIndex < sub.count {
if string[stringIndex] == sub[subIndex] {
@congnd
congnd / minesweeper.swift
Created February 21, 2020 00:20
Swift solution for minesweeper challenge: https://leetcode.com/problems/minesweeper
class Solution {
func updateBoard(_ board: [[Character]], _ click: [Int]) -> [[Character]] {
let h = board.count
let w = board[0].count
var copied = board
func checkAdjacentPoints(x: Int, y: Int) {
var numberOfBombs = 0
let path = UIBezierPath()
path.move(to: startPoint)
let endPoint = CGPoint(x: posX + CGFloat.random(in: ), y: 0)
let controlPoint1 = CGPoint(x: , y: )
let controlPoint2 = CGPoint(x: , y: )
path.addCurve(to: endPoint, controlPoint1: controlPoint1, controlPoint2: controlPoint2)
let animation = CAKeyframeAnimation(keyPath: #keyPath(CALayer.position))
animation.path = path.cgPath
let animation = CABasicAnimation(keyPath: #keyPath(CALayer.transform))
let angle = CGFloat.random(in: ) * CGFloat.pi
let rotation = CATransform3DMakeRotation(angle, 0, 1, 0)
let finalScale = CGFloat.random(in: 2…5)
let transoform = CATransform3DScale(rotation, finalScale, finalScale, 1)
animation.toValue = transoform