Skip to content

Instantly share code, notes, and snippets.

View katopz's full-sized avatar
🦀
Rust me if you can

Todsaporn Banjerdkit katopz

🦀
Rust me if you can
View GitHub Profile
# your svn folder should be at root like /svn
# to use at your terminal : bash migrate.sh OLD_SVN_URL REPO_NAME
# e.g. : bash migrate.sh http://foo/svn bar
export OLD_SVN_URL=$1
export REPO_NAME=$2
cd /svn
svnadmin create ${REPO_NAME}
chown -R apache.apache ${REPO_NAME}
cd /svn/${REPO_NAME}/hooks
#template for SVN config /etc/httpd/conf/extra/httpd-svn.conf
#svn folder must be at root tho
#try
#service httpd restart
#when done
LoadModule dav_svn_module /usr/lib/apache/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache/mod_authz_svn.so
<IfModule dav_svn_module>
@katopz
katopz / dump.sh
Created December 26, 2014 10:56
Load and Dump SVN
#dump.sh
#how to use : bash dump.sh your-old-repos-folder-name-go-here
svnadmin dump $1 > $1.svn_dump
#undump.sh
#how to use : bash undump.sh your-old-repos-folder-name-go-here
export REPO=$1
svnadmin create ${REPO}
chown -R apache.apache ${REPO}/
import UIKit
class EMCollectionViewFlowLayout: UICollectionViewFlowLayout {
override func targetContentOffsetForProposedContentOffset(proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
var _proposedContentOffset = CGPoint(x: proposedContentOffset.x, y: proposedContentOffset.y)
var offSetAdjustment: CGFloat = CGFloat.max
let horizontalCenter: CGFloat = CGFloat(proposedContentOffset.x + (self.collectionView!.bounds.size.width / 2.0))
let targetRect = CGRect(x: proposedContentOffset.x, y: 0.0, width: self.collectionView!.bounds.size.width, height: self.collectionView!.bounds.size.height)
@katopz
katopz / jxcore.sh
Created March 19, 2015 04:58
jxcore prerequisites
# Refer to https://github.com/jxcore/jxcore/blob/master/doc/HOW_TO_COMPILE.md
# Install brew first (Ruby should already there)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# GCC 4.2 or newer (for SpiderMonkey builds 4.7+)
brew install gcc
# Python 2.6 or 2.7
brew install python
# GNU Make 3.81 or newer (Not sure on this one, should be already come with xcode build tool?)
xcode-select --install
# libexecinfo (FreeBSD and OpenBSD only)
# to fix...
# Can’t locate loadable object for module SVN::_Core in @INC
# try
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/SVN /System/Library/Perl/Extras/5.18/SVN
# and
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN/ /System/Library/Perl/Extras/5.18/auto/SVN
@katopz
katopz / ParsePushAS3
Last active August 29, 2015 14:23
Will subscribe to all push notification via parse.com with pure as3
package
{
import flash.desktop.InvokeEventReason;
import flash.desktop.NativeApplication;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.events.InvokeEvent;
import flash.events.ProgressEvent;
@katopz
katopz / fb-like-check
Created July 22, 2015 09:40
Check like from like button visibility
// 2015/07/22
// nav to
https://www.facebook.com/v2.3/plugins/like.php?layout=button&locale=en_US&sdk=joey&share=false&show_faces=false&href=https%3A%2F%2Fm.facebook.com%2FHealthyPetZociety
// then console
window.getComputedStyle($(".pluginConnectButtonConnected")).display == "inline-block"
@katopz
katopz / WTF-PHP-MYSQL.md
Last active December 5, 2016 14:55
I hate PHP, MySQL stupid install ever :(
@katopz
katopz / .htaccess
Created August 16, 2015 17:23
For stupid ship PHP no async bastard
php_value max_execution_time 6000000
php_value memory_limit 128M