Skip to content

Instantly share code, notes, and snippets.

View ety001's full-sized avatar
🎯
Focusing

ety001 ety001

🎯
Focusing
View GitHub Profile
@ety001
ety001 / image-orientation.php
Created September 6, 2015 16:44
照片方向调整
<?php
function adjustPicOrientation($full_filename, $type = 'jpeg'){
$exif = exif_read_data($full_filename);
if($exif && isset($exif['Orientation'])) {
$orientation = $exif['Orientation'];
if($orientation != 1){
if($type == 'jpeg'){
$img = imagecreatefromjpeg($full_filename);
} else if($type == 'png') {
$img = imagecreatefrompng($full_filename);
@ety001
ety001 / nginx_proxy.conf
Created September 22, 2015 05:03
nginx proxy configuration
server
{
listen 80;
server_name xxxxxx;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://xxxxxx;
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ldsn -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-7536831447654223"
data-ad-slot="2809102979"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
atmega8_8M.name=ATmega8_8MHz
atmega8_8M.upload.protocol=arduino
atmega8_8M.upload.maximum_size=7168
atmega8_8M.upload.speed=115200
atmega8_8M.upload.tool=avrdude
atmega8_8M.bootloader.low_fuses=0xa4
atmega8_8M.bootloader.high_fuses=0xdc
atmega8_8M.bootloader.path=optiboot
@ety001
ety001 / facade_referer.php
Created January 14, 2016 08:02
facade_referer.php
<?php
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://www.jwc.ldu.edu.cn/cj");
curl_setopt ($ch, CURLOPT_REFERER, "http://www.jwc.ldu.edu.cn/cj");
curl_exec ($ch);
curl_close ($ch);
header('Location:http://www.jwc.ldu.edu.cn/cj');
import pygame
# Define some colors
BLACK = ( 0, 0, 0)
WHITE = ( 255, 255, 255)
# This is a simple class that will help us print to the screen
# It has nothing to do with the joysticks, just outputing the
# information.
class TextPrint:
#******************************************************************#
# /etc/ppp/chat/unicom-chat #
# this is the chat script for unicom #
# *****************************************************************#
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
##******************************************************************#
# /etc/ppp/peers/unicom-peers #
# this is ppp script for use chinaunicom's WCDMA data service #
#******************************************************************#
# note: If the kernel creat ttyUSB0 ttyUSB1 ttyUSB2 for our 3G dongle
# We should use ttyUSB2 for AT command
#/dev/ttyUSB2
115200
# if switch success, run our script
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", ATTR{idProduct}=="1506",MODE="0666", RUN+="/sbin/3g-dongle-cfg.sh"
#!/usr/bin/php
<?php
$tmpl_id = 'PT0X_93niu22Ti3CYqEL0bXPkflJ06zUK5Yt3_KCF_g';
$appid = 'wx54602a12c477c961';
$secret = 'dde1ceb8fb98cb3ec0a70e9f0849221b';
$user_id = 'oUeGNtz41L35y49a_xqXGjWeBazU';
$access_url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$appid.'&secret='.$secret;
$tmpl_url = 'https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=';