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
/** | |
* Changelog: | |
* | |
* 2015/11/24 | |
* - display full content of the posts and remove "read more" dots | |
* - display all comments (no need to scroll) | |
*/ | |
.fu5e3b.qhIQqf { | |
/* Show full post */ |
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
^\[[^\]]+\].*NotFoundHttpException.*[^\[]+\[\] \[\] |
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
.row { | |
margin: 0 -5px | |
} | |
.col { | |
width: 25%; | |
padding: 0 5px; | |
} |
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 | |
$strings = array( | |
'/bundle/foo/login', | |
'/bundle/foo/notLogin', | |
'/bundle/foo/loginNot', | |
'/bundle/foo/bar' | |
); | |
foreach ($strings as $string) { |
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
from optparse import OptionParser | |
import pprint | |
import os | |
import sys | |
import re | |
parser = OptionParser(usage="This script will fix docstrings in javascript files compiled by CoffeeScript.") | |
parser.add_option('-s', '--src', help='source directory') | |
(options, args) = parser.parse_args() |
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
// Input array | |
var input = [ | |
{ id: 1, name: 'Tom', status: 'Accepted', category: 'Admin' }, | |
{ id: 2, name: 'Chris', status: 'Not accepted', category: 'Moderator' }, | |
{ id: 3, name: 'July', status: 'Accepted', category: 'Moderator' }, | |
{ id: 4, name: 'John', status: 'To verify', category: 'Admin' }, | |
{ id: 5, name: 'Jeff', status: 'Accepted', category: 'Admin' }, | |
{ id: 6, name: 'Andrew', status: 'Accepted', category: 'Admin' }, | |
]; |
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
/** | |
* $defaults = array( | |
* 'a' => 2 | |
* 'b' => 2 | |
* ); | |
* $untrusted = array( | |
* 'a' => 4, | |
* 'c' => 4 | |
* ); | |
* print_r(arrayMergeDefault($default, $unstrusted)); |
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
$('[data-placeholder]').each(function() { | |
var $this = $(this), | |
text = $this.attr('data-placeholder'); | |
if ($this[0].nodeName == 'TEXTAREA') { | |
$this.text(text); | |
} else { | |
$this.val(text); | |
} |
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 https://gist.github.com/Potfur/5576225 & https://github.com/james2doyle/saltjs | |
// more info: https://plus.google.com/109231487156400680487/posts/63eZzzrBSb6 | |
window.$ = function(s) { | |
var c = { | |
'#': 'ById', | |
'.': 'sByClassName', | |
'@': 'sByName', | |
'=': 'sByTagName'}[s[0]]; | |
return document[c?'getElement'+c:'querySelectorAll'](s.slice(1)) | |
}; |
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 Browser | |
{ | |
public static function isMobile() | |
{ | |
$useragent=$_SERVER['HTTP_USER_AGENT']; | |
return (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\ |
NewerOlder