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 | |
#By Nate Flink | |
#Invoke on the terminal like this | |
#curl -s https://gist.github.com/nateflink/9056302/raw/findreplaceosx.sh | bash -s "find-a-url.com" "replace-a-url.com" | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "Usage: ./$0 [find string] [replace string]" | |
exit 1 | |
fi |
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 | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
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 | |
$js = ""; | |
$content = file_get_contents("http://website.com"); | |
preg_match_all('#<script(.*?)</script>#is', $content, $matches); | |
foreach ($matches[0] as $value) { | |
$js .= $value; | |
} |
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 | |
// source: http://php.net/manual/de/language.oop5.autoload.php#99173 | |
class autoloader { | |
public static $loader; | |
public static function init() | |
{ | |
if (self::$loader == NULL) | |
self::$loader = new self(); |
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 | |
add_filter( 'robots_txt', NS . 'customRobotsTxt', 10, 2 ); | |
function customRobotsTxt($output, $public) { | |
if(WP_ENV == 'production') { | |
return $output; | |
} else { | |
return "User-agent: *\nDisallow: /"; | |
} | |
} |
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
kill -9 `ps ax | grep node | grep meteor | awk '{print $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
# Your snippets | |
# | |
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
# expand the prefix into a larger code block with templated values. | |
# | |
# You can create a new snippet in this file by typing "snip" and then hitting | |
# tab. | |
# | |
# An example CoffeeScript snippet to expand log to console.log: | |
# |
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
Show hidden characters
{ | |
// Full list of supported options and acceptable values can be found here: | |
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md | |
"config": { | |
"block-indent": " ", | |
"vendor-prefix-align": true, | |
"space-before-closing-brace": "\n", | |
"space-before-selector-delimiter": 0, | |
"space-before-selector-delimiter": "", | |
"space-after-selector-delimiter": 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
// create the following file to insert the extra functionality rules-delimiter.js | |
// add the following to the configuration of csscomb: "rules-delimiter": 1 | |
// ~/Library/Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/lib/options/rules-delimiter.js | |
module.exports = { | |
name: 'rules-delimiter', | |
syntax: ['css', 'less', 'sass', 'scss'], | |
runBefore: "strip-spaces", | |
setValue: function(value) { | |
if (typeof value === 'number') { | |
value = Array(value + 1).join('\n'); |