This file contains 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
$(window).on('load', function() { | |
var player = $('video.wp-video-shortcode').data('mediaelementplayer'); | |
player.options.success = function(media, dom) { | |
if (media.pluginType === 'flash') { | |
media.addEventListener('canplay', function() { | |
// Player is ready | |
media.play(); | |
}, false); | |
} else { | |
media.play(); |
This file contains 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 | |
class Csv_Writer | |
{ | |
public $stream, $wrote = false; | |
function __construct() { | |
header( 'Content-Type: text/csv' ); | |
$this->stream = fopen('php://output', 'w'); | |
} |
This file contains 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
/** | |
* IPython Commands | |
*/ | |
shell: { | |
ipnb_kernel: { | |
command: 'ssh me@server "nohup ipython kernel &> kernel.log &"' | |
}, | |
ipnb_kernel_json: { | |
command: 'rsync -t me@server:~/.ipython/profile_default/security/kernel* ./kernel/' | |
}, |
This file contains 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
$('textarea').on('keyup', function() { | |
// store cursor location | |
var start = this.selectionStart, | |
end = this.selectionEnd, | |
len = this.value.length; | |
// remove duplicate spaces from field | |
$(this).val( | |
this.value.trim() | |
.replace(/(\n\n)+/g, '\n') |
This file contains 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
/** | |
Based on the work: | |
- http://jsfiddle.net/josedvq/3HG6d/ | |
- http://codeitdown.com/css-triangles-responsive/ | |
*/ | |
.responsive-triangle-base(@size; @color;) { | |
width: @size/2; | |
height: 0; |
This file contains 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
import urllib2, urllib | |
import simplejson | |
opener = urllib2.build_opener() | |
opener.addheaders = [('User-agent', 'Mozilla/5.0')] | |
class ImageApi(object): | |
uri = "http://ajax.googleapis.com/ajax/services/search/images?v=1.0&%s" | |
params = { 'q': 'term', 'imgsz': 'medium|large|xlarge', 'start': 0, 'imgtype': 'photo' } |
This file contains 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
$app->register('Jenssegers\Mongodb\MongodbServiceProvider'); | |
$app->withEloquent(); | |
$app->withFacades(); | |
config(['database.connections.mongodb' => array( | |
'driver' => 'mongodb', | |
'host' => env('DB_HOST', 'localhost'), | |
'port' => env('DB_PORT', 27017), | |
'username' => env('DB_USERNAME'), |
This file contains 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
# BEGIN WP Admin | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^wp-admin/(.*)$ /site/wp-admin/$1 [QSA,L] | |
RewriteRule ^wp-(.*)$ /site/wp-$1 [QSA,L] | |
</IfModule> | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
This file contains 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 | |
print_r([ | |
exec('woami'), // shell access | |
get_current_user(), // running user | |
file_get_contents('/etc/hosts') // open_basedir restriction | |
]); |
This file contains 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
.gpu { | |
-webkit-transform: translateZ(0); | |
} |
OlderNewer