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 (typeof markdown === 'undefined') var markdown = { | |
| parse: function (s) { | |
| var r = s, ii, pre1 = [], pre2 = []; | |
| // detect newline format | |
| var newline = r.indexOf('\r\n') != -1 ? '\r\n' : r.indexOf('\n') != -1 ? '\n' : '' | |
| // store {{{ unformatted blocks }}} and <pre> pre-formatted blocks </pre> | |
| r = r.replace(/{{{([\s\S]*?)}}}/g, function (x) { pre1.push(x.substring(3, x.length - 3)); return '{{{}}}'; }); | |
| r = r.replace(new RegExp('<pre>([\\s\\S]*?)</pre>', 'gi'), function (x) { pre2.push(x.substring(5, x.length - 6)); return '<pre></pre>'; }); |
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
| #!/bin/sh | |
| #current info | |
| CUR_URL=development.server.com | |
| CUR_DB_HOST=database_host | |
| CUR_DB_NAME=database_name | |
| CUR_DB_USER=database_user | |
| CUR_DB_PASS=database_password | |
| CUR_PATH=/path/to/site/ | |
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 | |
| /** | |
| * | |
| * Safe Search and Replace on Database with Serialized Data v2.0.1 | |
| * | |
| * This script is to solve the problem of doing database search and replace when | |
| * developers have only gone and used the non-relational concept of serializing | |
| * PHP arrays into single database columns. It will search for all matching | |
| * data on the database and change it, even if it's within a serialized PHP | |
| * array. |
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
| #!/bin/bash | |
| # | |
| # Starts a basic web server on the port specified. | |
| # | |
| # ./serve.sh 3000 -> http://localhost:3000 | |
| # | |
| # Copyright 2012 Eric Bidelman <[email protected]> | |
| port=$1 | |
| if [ $# -ne 1 ] |
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 | |
| $fileName = $_FILES['afile']['name']; | |
| $fileType = $_FILES['afile']['type']; | |
| $fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
| $dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
| $json = json_encode(array( | |
| 'name' => $fileName, | |
| 'type' => $fileType, | |
| 'dataUrl' => $dataUrl, |
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
| #!/bin/sh | |
| echo " | |
| Cool, let's start. | |
| " | |
| src=$PWD |
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
| sudo apt-get install nginx | |
| sudo apt-get install spawn-fcgi | |
| apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl |
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
| find ./ -name \*.php | xargs -n 1 php -l |
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
| sudo apt-get update | |
| sudo apt-get install lamp-server | |
| sudo apt-get install git | |
| cd /var/www/ | |
| sudo wget http://wordpress.org/latest.tar.gz | |
| sudo tar -zxvf latest.tar.gz && mv wordpress/* . && rmdir wordpress | |
| sudo rm index.html |
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
| // Prompts to http://stackoverflow.com/users/592125/forresto | |
| function loadgist(gistid) { | |
| $.ajax({ | |
| url: 'https://api.github.com/gists/' + gistid, | |
| type: 'GET', | |
| dataType: 'jsonp' | |
| }).success(function(gistdata) { | |
| // This can be less complicated if you know the gist file name | |