Skip to content

Instantly share code, notes, and snippets.

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

Nothing here! teeppiphat

🏠
Working from home
  • 22 Lab Co.,Ltd.
  • Bangkok, Thailand
View GitHub Profile
//-------------------------------------------------------------
//
// CMVideoSamplingPatcher
// Copyright © 2014 Egomotion Limited
//
// When using Xcode 6 and Unity 4.3.4 or earlier, iOS builds
// fail due to a missing include in CMVideoSampling.mm.
//
// This PostProcessBuild script adds the glext.h header
// to the CMVideoSampling.mm file if it is missing.
@teeppiphat
teeppiphat / 01_Laravel 5 Simple ACL manager_Readme.md
Created May 17, 2016 10:08 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@teeppiphat
teeppiphat / shadow.xml
Created December 9, 2016 07:55 — forked from lecho/shadow.xml
Android shadow drawable xml.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
@teeppiphat
teeppiphat / CircleAnimatedCheckBox.java
Created December 26, 2016 10:08 — forked from cesco89/CircleAnimatedCheckBox.java
A custom animated circle checkbox based on markushi's CircleButton (https://github.com/markushi/android-circlebutton)
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.CheckBox;
import android.widget.ImageView;
@teeppiphat
teeppiphat / Install Composer to use MAMP's PHP.md
Created July 15, 2017 13:07 — forked from kkirsche/Install Composer to use MAMP's PHP.md
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@teeppiphat
teeppiphat / mysql-docker.sh
Created April 26, 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
CREATE TABLE IF NOT EXISTS `currency` (
`currency_id` int(11) NOT NULL AUTO_INCREMENT,
`currency_name` varchar(64) DEFAULT NULL,
`currency_code` char(3) DEFAULT NULL,
PRIMARY KEY (`currency_id`),
KEY `idx_currency_name` (`currency_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
--
-- Dumping data for table `currency`
import getopt, sys
def main(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
except getopt.GetoptError:
print('sitechkr.py -i <inputfile> -o <outputfile>')
sys.exit(2)
import android.os.Build;
import android.util.Log;
import java.util.UUID;
public class UniqueDevice {
public String getAltImei(){
String uniquePseudoID = "35" +
Build.BOARD.length() % 10 +
EKSCTL_EXPERIMENTAL=true eksctl enable repo \
--cluster=eksworkshop-eksctl --region=eu-west-1 \
--git-url=https://github.com/teeppiphat/k8s-config \
--git-email=teeppiphat@gmail.com
helm upgrade -i helm-operator fluxcd/helm-operator \
--namespace flux \
--set configureRepositories.enable=true \
--set 'configureRepositories.repositories[0].name=stable' \
--set 'configureRepositories.repositories[0].url=https://kubernetes-charts.storage.googleapis.com' \