This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//set POST variables | |
$url = 'http://c.docverter.com/convert'; | |
$fields = array('from' => 'html', | |
'to' => 'pdf', | |
'input_files[]' => "@/".realpath('input.html').";type=text/html; charset=UTF-8", | |
); | |
$ch = curl_init(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function update_url($_data, $url = NULL){ | |
if (!$url) $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
$_url = parse_url($url); | |
if (isset($_url['query']) AND $_url['query']) parse_str($_url['query'], $_params); | |
else $_params = array(); | |
$_updated_params = array_merge($_params, $_data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run this with phantomjs | |
//create new webpage object | |
//var page = new WebPage(); | |
var page = require('webpage').create(); | |
//load the page | |
page.open('http://mfyz.com', function (status) { | |
//fire callback to take screenshot after load complete | |
page.render('mfyz.png'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// sample: <img src="counter.php?counter=total_visits"> | |
function hex2rgb($color){ | |
$color = str_replace('#', '', $color); | |
if (strlen($color) != 6){ return array(0,0,0); } | |
$rgb = array(); | |
for ($x=0;$x<3;$x++){ | |
$rgb[$x] = hexdec(substr($color,(2*$x),2)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular HTML5 Preview, Crop And Upload</title> | |
<style> | |
body { | |
padding: 50px; | |
font: 16px Helvetica; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// retina.less | |
@highdpi: ~"# (-webkit-min-device-pixel-ratio: 1.5), # (min--moz-device-pixel-ratio: 1.5), # (-o-min-device-pixel-ratio: 3/2), # (min-resolution: 1.5dppx)"; | |
.retinaBg(@path, @w: auto, @h: auto, @prefix: _) { | |
background-image: url(@path); | |
@at2x_path: ~`@{path}.replace(/\.\w+$/, function(match) { return "@2x" + match; })`; | |
@final_media: ~`"@{highdpi}".replace(/(\#)/g, function(match) { return ("@{prefix}".length > 1 ? " @{prefix} and " + match : ""); }).replace(/\#/g, '')`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var fs = require('fs'); | |
var auth = express.basicAuth(function(user, pass) { | |
return user === 'test' && pass === 'pass'; | |
}); | |
app.get('/', auth, function(req, res) { | |
res.setHeader('Content-Type', 'text/html'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tapStartX, tapStartY; | |
list_item.on(Events.TouchStart, function(e){ tapStartX = e.pageX; tapStartY = e.pageY; }); | |
list_item.on(Events.TouchEnd, function(e){ | |
if (Math.abs(e.pageX - tapStartX) < 20 && Math.abs(e.pageY - tapStartY) < 20) { | |
// real tap happened | |
} | |
}); |
OlderNewer