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
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Support\Facades\Auth; | |
class Authenticate | |
{ | |
/** |
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
<?php | |
$projects = [ | |
'1 ร้านเช่า หนังสือ', | |
'2 ร้านเช่า ชุดเสื้อผ้า เครื่องแต่งกาย', | |
'3 ร้านเช่า รถยนต์', | |
'4 ระบบสมัครสมาชิก', | |
'5 เว็บ Blog', | |
'6 ระบบจองคิวคลินิก', | |
'7 ระบบสั่งอาหารจากโต๊ะ', | |
'8 ระบบคำนวณเกรดวิชาเรียน', |
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
FROM ubuntu:latest | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get install -y vim curl wget | |
RUN apt-get install -y software-properties-common language-pack-en-base | |
RUN LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php | |
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 | |
RUN add-apt-repository -y 'deb [arch=amd64,i386,ppc64el] http://mirrors.bestthaihost.com/mariadb/repo/10.1/ubuntu xenial main' |
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
wget -O /dev/null [[URL]] |
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 | |
apt-key adv --keyserver keys.gnupg.net --recv-keys 6BF18B15 | |
CODENAME=$(lsb_release -cs | sed -n '/lucid\|precise\|quantal\|raring\|saucy\|trusty\|squeeze\|wheezy\|jessie\|sid/p') | |
echo "" >> /etc/apt/sources.list | |
echo "#### BitTorrent Sync - see: http://forum.bittorrent.com/topic/18974-debian-and-ubuntu-server-packages-for-bittorrent-sync-121-1/" >> /etc/apt/sources.list | |
echo "## Run this command: apt-key adv --keyserver keys.gnupg.net --recv-keys 6BF18B15" >> /etc/apt/sources.list | |
echo "deb http://debian.yeasoft.net/btsync ${CODENAME:-sid} main" >> /etc/apt/sources.list | |
echo "deb-src http://debian.yeasoft.net/btsync ${CODENAME:-sid} main" >> /etc/apt/sources.list | |
unset CODENAME | |
apt-get update |
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
package main | |
import "encoding/json" | |
// Unescape UTF-8 string | |
// e.g. convert "\u0e27\u0e23\u0e0d\u0e32" to "วรญา" | |
func UnescapeString(str string) (unescapedString string) { | |
json.Unmarshal([]byte(`"`+str+`"`), &unescapedString) | |
return | |
} |
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
<?php | |
$fullActions = ['U'=>'Up', 'L'=>'Left', 'R'=>'Right', 'D'=>'Down']; | |
$fullMoves = ['U'=>'^', 'L'=>'<', 'R'=>'>', 'D'=>'v']; | |
$rewards = [[-0.04,-0.04,-0.04], | |
[-0.04,-1,1], | |
[-0.04,-0.04,-0.04]]; |
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 java.security.*; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.FileInputStream; | |
import java.io.DataInputStream; | |
import java.io.ByteArrayInputStream; | |
import java.io.FileOutputStream; | |
import java.security.spec.*; | |
import java.security.cert.Certificate; | |
import java.security.cert.CertificateFactory; |
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
<?php | |
chdir(__DIR__); | |
define('LAST_FILE', 'last_manga.json'); | |
define('MANGA_DIR', 'manga'); | |
$names = []; | |
$names[] = 'terra-formars'; |
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
# Update no-ip ip every one hour | |
0 * * * * curl "YOUR_HOST_URL/noip-updater.php" > /dev/null 2>&1 |