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
config.toolbar = 'Full'; | |
config.toolbar_Full = | |
[ | |
{ name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] }, | |
{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] }, | |
{ name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] }, | |
{ name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', | |
'HiddenField' ] }, | |
'/', |
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
// Filters data against security risks. | |
function filter($data) { | |
if (is_array($data)) { | |
foreach ($data as $key => $element) { | |
$data[$key] = filter($element); | |
} | |
} else { | |
$data = trim(htmlentities(strip_tags($data))); | |
if(get_magic_quotes_gpc()) { | |
$data = stripslashes($data); |
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 | |
$ds = DIRECTORY_SEPARATOR; | |
$storeFolder = 'uploads'; | |
function slugify($text) { | |
// replace non letter or digits by - | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $text); | |
// trim | |
$text = trim($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
<?php | |
$images = array(); | |
if ($handle = opendir('uploads')) { | |
while (false !== ($entry = readdir($handle))) { | |
$check = preg_match("/\.(jpg|jpeg|png|gif|webp)/i", $entry); | |
if ($entry != "." && $entry != ".." && $check) { | |
$alt = preg_replace('/\.(jpg|jpeg|png|gif|webp)/', '', $entry); | |
$image_info = getimagesize('uploads/'.$entry); | |
$images[] = array( |
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
$.fn.extend( { | |
swappable: function(options) { | |
this.defaults = { | |
id: 'swappable-temp-input', | |
class: 'swappable-input', | |
name: 'swappable-temp', | |
type: 'input', | |
evt: 'click', | |
end: 'blur', | |
detectTag: 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
// compile with: gdmd -O -inline -release -noboundscheck replace-css-vars.d | |
// usage: ./replace-css-vars text.less | |
import std.stdio, std.file, std.regex, std.string; | |
string FILE; | |
// empty a line | |
string clearLine(string content, string subject) { | |
auto com = regex(subject, "g"); | |
auto newcontent = replaceAll(content, com, ""); |
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
# min (0-59), hour (0-23), DOM (1-31), MOY (1-12), DOW (0-6 with 0=Sunday). | |
# the following will clear the Apache error log at one minute past midnight each day. | |
01 00 * * * echo "" > /www/apache/logs/error_log |
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.pyro = { | |
base_url: "{{ url:base }}", | |
current_url: "{{ url:current }}", | |
layout: "{{ page:layout:slug }}", | |
segement: "{{ url:segments segment="1" }}", | |
module: "{{ global:module }}" | |
}; |
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
String.prototype.bool = function() { | |
return (/^true$/i).test(this); | |
}; |
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
-- only read files with MD extension | |
set myFile to (POSIX path of (choose file with prompt "Select a file to read:" of type {"MD"})) | |
-- pipe the content into cat and then apply the result to theContent | |
set theContent to (do shell script "cat " & myFile) of result | |
display dialog theContent | |
-- close the file | |
close access myFile |
OlderNewer