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 vboxSetCookie(k,v,expire) { | |
var exp = (v ? (expire ? expire : new Date(2020,12,24)) : new Date().setDate(new Date().getDate() - 1)); | |
document.cookie = k+"="+v+"; expires="+exp.toGMTString()+"; path=/"; | |
} | |
function vboxSetLocalDataItem(k,v,nocookies) { | |
// fall back to normal cookie | |
if(typeof(Storage)==="undefined") { |
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
This tool is awesome !!! | |
config.toolbar = [ | |
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Print',] }, | |
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, | |
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Bl | |
'/', | |
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFo | |
{ name: 'styles', items: [ 'Format', 'Font', 'FontSize' ] }, | |
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] }, |
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
<script src="./tinymce/js/tinymce/tinymce.min.js"></script> | |
<!-- Example row of columns --> | |
<div class="row"> | |
<div class="span12"> | |
<script type="text/javascript"> | |
tinymce.init({ | |
menubar:false, | |
statusbar: false, | |
selector: "#edit", |
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
defaults write NSGlobalDomain KeyRepeat -int 1 # from 0 to 2, 2 is the fastest |
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
ALTER TABLE django_admin_log MODIFY COLUMN object_repr VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; |
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
try: | |
from markdown import markdown | |
except ImportError: | |
class MarkdownNotFound(Exception): | |
def __str__(self): | |
return "Markdown is not installed!" | |
raise MarkdownNotFound |
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
def fibonacci(max): | |
a, b = 0, 1 | |
while a < max: | |
yield a | |
a, b = b, a+b | |
print [x for x in fibonacci(100)] |
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
if not re.search(romanNumeralPattern, s): | |
raise InvalidRomanNumeralError, 'Invalid Roman numeral: %s' % s |
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
history | awk '{CMD[$2]++;count++;} END { for (a in CMD )print CMD[ a ]" " CMD[ a ]/count*100 "% " a }' | grep -v "./" | column -c3 -s " " -t |sort -nr | nl | head -n10 |
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 | |
function getMacLinux() { | |
exec('netstat -ie', $result); | |
if(is_array($result)) { | |
$iface = array(); | |
foreach($result as $key => $line) { | |
if($key > 0) { | |
$tmp = str_replace(" ", "", substr($line, 0, 10)); | |
if($tmp <> "") { | |
$macpos = strpos($line, "HWaddr"); |