Skip to content

Instantly share code, notes, and snippets.

Chrome 19
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5
FireFox 13
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Safari 5.1
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
Opera 11
@iwek
iwek / twitter-search-results.php
Created July 9, 2012 14:47
PHP Twitter Results without Retweets and Duplicates
<?php
/**
* Twitter Search Results PHP script that removes retweets and similar tweets.
*
* @author http://techslides.com
* @link http://techslides.com/grab-twitter-results-with-php-and-remove-retweets-and-duplicates
*/
@iwek
iwek / twitter-list-reorder.php
Created July 9, 2012 17:09
Twitter List Tweets PHP script that order tweets by user.
<?php
/**
* Twitter List Tweets PHP script that order tweets by user.
*
* @author http://techslides.com
* @link http://techslides.com/grab-twitter-list-tweets-order-by-user
*/
function curl($url){
@iwek
iwek / html5-video-test
Created July 9, 2012 18:12
HTML5 Video Test
<video controls>
<source src=http://techslides.com/demos/sample-videos/small.webm type=video/webm>
<source src=http://techslides.com/demos/sample-videos/small.ogv type=video/ogg>
<source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4>
<source src=http://techslides.com/demos/sample-videos/small.3gp type=video/3gp>
</video>
@iwek
iwek / grab-images-wikipedia.php
Created July 12, 2012 20:38
Retrieve Images from Wikipedia
<?php
/**
* Grab Images from Wikipedia via thier API
*
* @author http://techslides.com
* @link http://techslides.com/grab-wikipedia-pictures-by-api-with-php
*/
//curl request returns json output via json_decode php function
@iwek
iwek / wget-website-save.php
Created July 13, 2012 13:12
wget with php exec to save website
<?php
$url = 'csslint.net';
$cmd = "wget -nd -p --convert-links -P downloads/csslint \"$url\" ";
exec($cmd);
?>
@iwek
iwek / asperjs-useragent-test.js
Created July 16, 2012 20:07
casperjs user-agent example
var casper = require('casper').create();
var webpage = "http://wordpress.org/";
casper.on('resource.requested', function(resource) {
for (var obj in resource.headers) {
var name = resource.headers[obj].name;
var value = resource.headers[obj].value;
if (name == "User-Agent"){
@iwek
iwek / casperjs-multibrowser-screenshots.js
Created July 16, 2012 20:27
multibrowser screenshots with casperjs
var casper = require('casper').create({
viewportSize: {
width: 1024,
height: 768
}
});
var webpage = "http://wordpress.org/";
var useragents = [
@iwek
iwek / cookies.js
Created July 17, 2012 14:31
view and disable cookies in casperjs and phantomjs
//to disable cookies, run casperjs --cookies-file=/dev/null? cookies.js
var casper = require('casper').create();
casper.start('http://wordpress.org/', function() {
this.echo('Browser Cookie: ' + this.evaluate(function() {
return document.cookie;
}));
});
@iwek
iwek / select-state.html
Created July 27, 2012 20:52
list of US states in alphabetical order and in a select box
<select name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="FL">Florida</option>