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
<div id="msg"></div> | |
<?php | |
set_time_limit(0); | |
if (ob_get_level() == 0) ob_start(); | |
for($i=0;$i<=500;$i++) { | |
//echo 'I = '.$i."<br>"; | |
//echo str_pad('',4096)."\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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// In this example we detect if a user clicks a link to travel elsewhere | |
// but has made changes to a form. If they have changed the form it prompts | |
// them to confirm before continuing. | |
jQuery(function ($) { | |
var $form = $('form').watchChanges(); | |
$('a').click(function (e) { | |
if ($form.hasChanged() and ! confirm('Continue without saving changes?')) { | |
e.preventDefault(); | |
} |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
var bar_width = 200; | |
function progress() { | |
var node = document.getElementById('progress'); | |
var w = node.style.width.match(/\d+/); | |
if (w == bar_width) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<style> | |
#dialogoverlay{ | |
display: none; | |
opacity: .8; | |
position: fixed; | |
top: 0px; |
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
//20160429 HTML To BBCode | |
public function sHtmlToBbcode($html, $bbcode_uid = 0){ | |
$tags = array( | |
'#<strong>(.*?)</strong>#si' => '[b]\\1[/b]', | |
'#<b>(.*?)</b>#si' => '[b]\\1[/b]', | |
'#<em>(.*?)</em>#si' => '[i]\\1[/i]', | |
'#<i>(.*?)</i>#si' => '[i]\\1[/i]', | |
'#<u>(.*?)</u>#si' => '[u]\\1[/u]', | |
'#<s>(.*?)</s>#si' => '[s]\\1[/s]', | |
'#<h2>(.*?)</h2>#si' => '[h1]\\1[/h1]', |
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
# status line を更新する間隔を 1 秒にする | |
set-option -g status-interval 1 | |
# window-status を中央揃えで配置する | |
set-option -g status-justify "centre" | |
# status line の背景色を指定する。 | |
set-option -g status-bg "colour238" | |
# status line の文字色を指定する。 |
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
set-window-option -g status-left " #S " | |
set-window-option -g status-left-fg black | |
set-window-option -g status-left-bg white | |
set-window-option -g status-right " %H:%M %d-%b-%y " | |
set-window-option -g status-right-fg black | |
set-window-option -g status-right-bg white | |
set-window-option -g window-status-format " #I: #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
{ | |
"auto_close_tags": true, | |
"auto_complete": false, | |
"auto_indent": true, | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/Color Scheme - Default/All Hallow's Eve.tmTheme", | |
"default_encoding": "UTF-8", | |
"font_size": 12, | |
"gutter": true, |
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 | |
// 重複的關鍵字只替換一次 | |
$str = "http://www.school.com/asdf2m/asdf/dd1234acfgesger/asdf/asdf/屁屁"; | |
$a = array('/(AC)/i','/(ac)/i','/(dd1234)/i','/(dd12)/i','/(er)/i','/(屁屁)/i'); | |
echo my_replace($a, $str); | |
function my_replace($aKeyword, $sString){ | |
$aTmp = preg_replace($aKeyword, "[indent]$1[/indent]" , $sString); | |
return parseTagsRec($aTmp); |
OlderNewer