This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Nice trick to add floating view on bottom layout in UITableViewController | |
**/ | |
import UIKit | |
class MyUITableViewController : UITableViewController { | |
fileprivate lazy var myFloatingView: UIView = { | |
let myView = UIView(frame: CGRect(x: 0.0, y: 0.0, width: self.view.bounds.width, height: 80.0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extention UIView { | |
func addConstrainWithFormat(format: String , views: UIView...){ | |
var viewsDictionary = [String: UIView]() | |
for(index, view) in views.enumerated() { | |
let key = "v\(index)" | |
view.translatesAutoresizingMaskIntoConstraints = false | |
viewsDictionary[key] = view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugfy(text){ | |
return text.toString().toLowerCase().trim() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/&/g, '-and-') // Replace & with 'and' change 'and' with your text like 'dan' for indonesian | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-'); | |
} | |
//source : https://gist.github.com/mathewbyrne/1280286 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
## | |
#increase php timeout | |
## | |
fastcgi_read_timeout 300; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ \.php$ { | |
include /etc/nginx/fastcgi_params; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
#kita tambahkan disini | |
fastcgi_read_timeout 300; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getUrl($genre, $page) { | |
$agents = array( | |
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1', | |
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100508 SeaMonkey/2.0.4', | |
'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)', | |
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; da-dk) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1', | |
'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11', | |
'Opera/9.25 (Windows NT 5.1; U; en)', | |
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', | |
'Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.5 (like Gecko) (Kubuntu)', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
laa = 'My Name' | |
broo = 'Laa BroÖntë' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function curl_get_header($url = '', $user_agent = '', $headers = array()) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); | |
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
return $result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PETUNJUK INSTALASI | |
=================== | |
Update config di app/storage/config/config.php | |
Petunjuk pengisian: | |
> untuk penggunaan themes SINGLE STORE | |
* 'indexreq' diisi men atau women atau kids atau home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#!/bin/sh | |
rpm -Uvh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm && | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel freetype-devel speex-devel -y && | |
mkdir ~/ffmpeg_sources && | |
cd ~/ffmpeg_sources && | |
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && | |
tar xzvf yasm-1.3.0.tar.gz && | |
cd yasm-1.3.0 && | |
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && |
NewerOlder