Skip to content

Instantly share code, notes, and snippets.

View zry656565's full-sized avatar
🚀
Ship it

Jerry Zou zry656565

🚀
Ship it
View GitHub Profile
@zry656565
zry656565 / iframe_document.js
Last active August 29, 2015 14:11
[front-end] Get document object of iframe
//original javascript
var doc = document.getElementById('iframeId').contentWindow.document;
//jquery
var doc = $('#iframe').contents();
@zry656565
zry656565 / ShortUrl.php
Created December 12, 2014 04:02
获取新浪短域名的方法(PHP版)
<?php
class ShortUrl {
private static function getJson($url) {
$ch = curl_init($url);
curl_setopt_array( $ch, [
CURLOPT_AUTOREFERER => TRUE,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => TRUE,
@zry656565
zry656565 / css-hack.css
Last active August 29, 2015 14:11
CSS-hack
/* clearfix */
/*=============================*/
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
/* IE 6/7 */
.clearfix { zoom: 1; }
/* transparent */
/* via http://perishablepress.com/cross-browser-transparency-via-css/ */
/*=============================*/
blockquote {
background: #f9f9f9;<
border-left: 10px solid #ccc;
margin: 1.5em 10px;
padding: .5em 10px;
quotes: "\201C""\201D""\2018""\2019";
}
blockquote:before {
color: #ccc;
content: open-quote;
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
}
/* Smartphones (portrait) ----------- */
img.polaroid {
background:#000; /*Change this to a background image or remove*/
border:solid #fff;
border-width:6px 6px 20px 6px;
box-shadow:1px 1px 5px #333; /* Standard blur at 5px. Increase for more depth *
-webkit-box-shadow:1px 1px 5px #333;
-moz-box-shadow:1px 1px 5px #333;
height:200px; /*Set to height of your image or desired div*/
width:200px; /*Set to width of your image or desired div*/
}
@zry656565
zry656565 / pullquote.css
Created December 12, 2014 05:44
usually used to show quotes in paragraph. via: http://miekd.com/articles/pull-quotes-with-html5-and-css/
.has-pullquote:before {
/* Reset metrics. */
padding: 0;
border: none;
/* Content */
content: attr(data-pullquote);
/* Pull out to the right, modular scale based margins. */
float: rightright;
width: 320px;
margin: 12px -140px 24px 36px;
html {
background: url('images/bg.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@zry656565
zry656565 / gradient.css
Created December 12, 2014 05:48
color gradient
#colorbox {
background: #629721;
background-image: -webkit-gradient(linear, left top, left bottombottom, from(#83b842), to(#629721));
background-image: -webkit-linear-gradient(top, #83b842, #629721);
background-image: -moz-linear-gradient(top, #83b842, #629721);
background-image: -ms-linear-gradient(top, #83b842, #629721);
background-image: -o-linear-gradient(top, #83b842, #629721);
background-image: linear-gradient(top, #83b842, #629721);
}
@zry656565
zry656565 / hideOverflowWords
Last active August 29, 2015 14:11
Show a line and hide overflow words
.hide-overflow-word {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}