Skip to content

Instantly share code, notes, and snippets.

View ZerglingGo's full-sized avatar
🎯
Focusing

ZerglingGo ZerglingGo

🎯
Focusing
View GitHub Profile
<?php
require_once "../include/php/Snoopy.class.php";
$http = new Snoopy;
$http->agent = "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0";
$http->fetch("http://www.zzamtoon.com/");
$http->setcookies();
$http->referer = "http://www.zzamtoon.com/webtoon/detail/code/1275/ep/0/toon/253";
$http->fetch("http://www.zzamtoon.com/webtoon/detail/code/1275/ep/0/toon/253");
$output = $http->results;
<?php
$name = $_REQUEST['name'];
$info = $_REQUEST['info'];
// $name = ['a', 'b', 'c'];
// $info = [[1, 2, 3],
// [3, 4, 5],
// [1, 2, 1]];
$result = array();
@ZerglingGo
ZerglingGo / page_image.php
Last active November 28, 2016 11:50
Output different images for each page
<?php
$defaultPage = 'main';
$page = isset($_GET['page']) ? $_GET['page'] : $defaultPage; // /page/{$page}
$imageCount = [
'main' => 5,
'click_prot' => 6,
'request' => 1,
'news_ad' => 1,
'info' => 1,
@ZerglingGo
ZerglingGo / PREVENT_DUPLICATION.sql
Last active November 17, 2017 08:10
Example query to prevent duplication for user id with same date
-- phpMyAdmin SQL Dump
-- version 4.5.3.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- 생성 시간: 17-11-17 17:08
-- 서버 버전: 10.1.12-MariaDB-1~trusty
-- PHP 버전: 7.0.4-1+deb.sury.org~trusty+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

Keybase proof

I hereby claim:

  • I am ZerglingGo on github.
  • I am zerglinggo (https://keybase.io/zerglinggo) on keybase.
  • I have a public key whose fingerprint is 8281 E477 8E83 0529 D3A9 FDE9 98C8 7983 A604 C4C4

To claim this, I am signing this object:

@ZerglingGo
ZerglingGo / eip-allocator.php
Created August 31, 2018 08:40
PHP AWS Elastic IP Allocator
<?php
require 'vendor/autoload.php';
use Aws\Ec2\Ec2Client;
$ec2Client = new Ec2Client([
'region' => 'ap-northeast-2',
'version' => 'latest',
'profile' => 'default',
]);