Skip to content

Instantly share code, notes, and snippets.

View gongpeione's full-sized avatar

Geeku gongpeione

View GitHub Profile
@gongpeione
gongpeione / brokenImg
Created June 24, 2015 01:02
Replace a broken image with pure HTML/CSS
<object data="error.img" type="image/png">
<img src="http://www.computerweekly.com/blogs/cwdn/2011/01/25/Human%20error.png" />
</object>
@gongpeione
gongpeione / pathinfo
Created June 24, 2015 06:01
solve codeigniter 404 error in Nginx
##########################################pathinfo 模式
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$"){
set $real_script_name $1;
set $path_info $2;
}
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
@gongpeione
gongpeione / IEImageResize
Created June 25, 2015 02:03
IE image resize
img { -ms-interpolation-mode: bicubic; }
@gongpeione
gongpeione / theme-color
Created June 29, 2015 09:06
THEME COLOR IN CHROME 39 (ANDROID LOLLIPOP)
<meta name="theme-color" content="#db5945">
@gongpeione
gongpeione / tempTable
Created July 14, 2015 10:02
create temporary table with tables name
SELECT *
FROM
(
SELECT *, 'cdk_record_07' as tableName FROM cdk_record_07
UNION ALL
SELECT *, 'cdk_record_01' as tableName FROM cdk_record_01
) s
@gongpeione
gongpeione / pointer-events
Last active August 29, 2015 14:27
pointer-events
pointer-events: none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='your_transparent.png', sizingMethod='scale');
background: none !important;
@gongpeione
gongpeione / broswerFontOptimize
Created December 3, 2015 06:34
broswerFontOptimize
html {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
@gongpeione
gongpeione / gist.js
Created July 18, 2016 08:26
event trigger
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
https://gist.github.com/gongpeione.atom
@gongpeione
gongpeione / githubOAuth.php
Last active May 26, 2017 08:51
Github OAuth PHP
<?php
// error_reporting(E_ALL);
$code = $_GET['code'];
$token = $_COOKIE['access_token'];
if (!empty($code)) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://github.com/login/oauth/access_token");
curl_setopt($ch, CURLOPT_POST, 1);