Skip to content

Instantly share code, notes, and snippets.

@thanhluu
thanhluu / functions.php
Created August 27, 2018 03:44
Social Share
function maki_social_share() { ?>
<a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-show-count="false">Tweet</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<iframe src="https://www.facebook.com/plugins/share_button.php?href=<?php echo get_permalink(); ?>%2F&layout=button_count&size=small&mobile_iframe=true&appId=256426884379026&width=78&height=20" width="78" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media"></iframe>
<script src="https://apis.google.com/js/platform.js" async defer></script><g:plus action="share"></g:plus>
<?php }
add_filter( 'the_content', 'maki_social_share' );
@thanhluu
thanhluu / privacy-policy.md
Last active August 14, 2018 15:30
Bon Bon City Tour Privacy Policy

Please read this privacy policy carefully. Respecting the privacy rights of our customers is very important to us. We are committed to complying with the Data Protection Act 1998 and, when it comes into force, the General Data Protection Regulation 2016/679. This privacy policy explains how we collect, store and use personal data about you when you visit our website - www.opensea.vn, and our mobile, tablet and other applications (our "Sites"). This policy applies to all our Sites regardless of how they are made available to you or accessed by you.

Please read this privacy policy carefully before you start using our Sites, as this policy will apply to your use of our Sites

By accessing, browsing and using our Sites, you confirm that you accept this privacy policy. If you do not want your data to be used as set out in this privacy policy, you should not use our Sites. However, you do not have to consent to any of our marketing in order to use our Sites or receive our products. If you have consented to direct

@thanhluu
thanhluu / gist:50c5349a6943e10136a5fad2ee34bdd0
Created June 16, 2017 16:55
Capture Screenshot by Chrome
// Install Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
google-chrome --headless --disable-gpu --hide-scrollbars --screenshot --virtual-time-budget=1000 --window-size=1600,1200 https://www.pagebold.com
@thanhluu
thanhluu / Swift FAQ.md
Last active July 9, 2016 16:06
Swift FAQ
@thanhluu
thanhluu / ParameterEncoding.swift
Created July 5, 2016 15:17
Parameter Encoding
//
// ParameterEncoding.swift
//
// Copyright (c) 2014-2016 Alamofire Software Foundation (http://alamofire.org/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@thanhluu
thanhluu / BaiTapAutoLayout-2.swift
Created June 27, 2016 15:23
Bai Tap Auto Layout 2
class MyViewController: UIViewController {
let blueView = UIView()
let greenView = UIView()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(greenView)
view.addSubview(blueView)
}
@thanhluu
thanhluu / BaiTapAutoLayout.swift
Created June 24, 2016 12:13
BaiTapAutoLayout
class MyViewController: UIViewController {
let sampleView = UIView()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(sampleView)
}
override func viewWillLayoutSubviews() {
import Foundation
let label = UILabel()
func getRecentBlogPost(completion: NSURLResponse -> Void) {
let session = NSURLSession(configuration: .defaultSessionConfiguration())
let url = NSURL(string: "http://blog.teamtreehouse.com/api/get_recent_summary?count=20")!
let request = NSURLRequest(URL: url)
let dataTask = session.dataTaskWithRequest(request) { data, response, error in
@thanhluu
thanhluu / Standard Library Functions.swift
Last active May 26, 2016 15:16
Standard Library Functions
let values = [1,2,3,4,5]
var newArray = [Int]()
for number in values {
newArray.append(number * 2)
}
let tripledValues = values.map { $0 * 3 }
// Map
@thanhluu
thanhluu / Closure Expressions.swift
Created May 19, 2016 16:38
Closure Expressions
func doubler(i: Int) -> Int {
return i * 2
}
let doubleFunction = doubler
doubleFunction(2)
let numbers = [1,2,3,4,5]
let doubleNumbers = numbers.map(doubleFunction)