Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

ZerglingGo ZerglingGo

🎯
Focusing
View GitHub Profile
@ZerglingGo
ZerglingGo / eip-allocator.php
Created Aug 31, 2018
PHP AWS Elastic IP Allocator
View eip-allocator.php
<?php
require 'vendor/autoload.php';
use Aws\Ec2\Ec2Client;
$ec2Client = new Ec2Client([
'region' => 'ap-northeast-2',
'version' => 'latest',
'profile' => 'default',
]);
View keybase.md

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 / PREVENT_DUPLICATION.sql
Last active Nov 17, 2017
Example query to prevent duplication for user id with same date
View PREVENT_DUPLICATION.sql
-- 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";
@ZerglingGo
ZerglingGo / page_image.php
Last active Nov 28, 2016
Output different images for each page
View page_image.php
<?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,
View sort.php
<?php
$name = $_REQUEST['name'];
$info = $_REQUEST['info'];
// $name = ['a', 'b', 'c'];
// $info = [[1, 2, 3],
// [3, 4, 5],
// [1, 2, 1]];
$result = array();
View zzamtoonparse.php
<?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;