Skip to content

Instantly share code, notes, and snippets.

View geek1706's full-sized avatar
🏠
Working from home

Trung Nguyen geek1706

🏠
Working from home
View GitHub Profile
override func draw(_ rect: CGRect) {
UIColor.white.setFill()
let minX: CGFloat = 0
let maxX = rect.width
let maxY = rect.height
let midX = rect.midX
let circleRadius: CGFloat = 45
let roundingRadius: CGFloat = 6
@geek1706
geek1706 / workaround.m
Created May 15, 2017 07:59 — forked from steipete/workaround.m
If you're implementing child view controllers and want automaticallyAdjustsScrollViewInsets to work...
// This ensures that the automaticallyAdjustsScrollViewInsets magic works
// On our newly added view controller as well.
// This triggers _layoutViewController which then triggers
// _computeAndApplyScrollContentInsetDeltaForViewController:
// which finally updates our content inset of the scroll view (if any)
// rdar://19053416
[self.navigationController.view setNeedsLayout];
@geek1706
geek1706 / git_submodules.md
Created April 18, 2018 02:49 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@geek1706
geek1706 / mysql-docker.sh
Created May 13, 2018 05:57 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
https://drive.google.com/uc?export=view&id=
https://source.unsplash.com/random/1024x1024
@geek1706
geek1706 / git-commit-log-stats.md
Created May 17, 2018 01:31 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@geek1706
geek1706 / sketch.sh
Created May 22, 2018 01:38
sketch without expiring trial
#!/bin/bash
date 0102030405
open /Applications/Sketch.app
ntpdate -u time.apple.com
- lay bai hat lien quan:
http://mp3.zing.vn/xhr/recommend?type=audio&id=ZW67OIA0
- lay du lieu thong qua key:
http://mp3.zing.vn/xhr/media/get-source?type=audio&key=kmJHTZHNCVaSmSuymyFHLH
http://mp3.zing.vn/html5xml/song-xml/kmJHTZHNCVaSmSuymyFHLH
- tim bai hat:
http://ac.mp3.zing.vn/complete?type=artist,song,key,code&num=500&query=Anh Thế Giới Và Em