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.linkify_tweet = function() { | |
var tweet = this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g, function(url) { | |
var wrap = document.createElement('div'); | |
var anch = document.createElement('a'); | |
anch.href = url; | |
anch.target = "_blank"; | |
anch.innerHTML = url; | |
wrap.appendChild(anch); | |
return wrap.innerHTML; | |
}); |
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
#With Basic Auth | |
curl --user someuser:somepassword -d 'some_post=variables&go=here' http://api.somecoolapi.com/json.somedata | python -mjson.tool >> /path/of/file/to/export/to.txt | |
#Without Basic Auth | |
curl -d 'some_post=variables&go=here' http://api.somecoolapi.com/json.somedata | python -mjson.tool >> /path/of/file/to/export/to.txt | |
#More Goodies: http://www.davidslog.com/1187630823/format-xml-json-from-command-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
<!-- Some embed code in any template --> | |
{embed='site/_header' title='Some Title' keywords='some,keywords' description='a description'} | |
<!-- site.group/_header.html --> | |
<!doctype html> | |
<html> | |
<head> | |
<title>{embed:title}</title> | |
<meta name="keywords" content="{embed:keywords}" /> | |
<meta name="description" content="{embed:description}" /> |
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
#!/usr/bin/bash | |
git clone https://github.com/paulirish/html5-boilerplate.git | |
cd html5-boilerplate | |
git checkout v2.0stripped |
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
resources.locale.default = "en_US" | |
resources.translate.content = APPLICATION_PATH "/../data/locales" | |
resources.translate.scan = "directory" | |
resources.translate.adapter = "csv" | |
resources.translate.delimiter = "," | |
resources.translate.default = "en" | |
;File localization structure example: | |
; | |
; project_root/data/locales/en/lang_en.csv |
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 | |
class IndexController extends Zend_Controller_Action | |
{ | |
private $lang; | |
public function init() { | |
$this->lang = Zend_Registry::get('Zend_Translate'); |
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> | |
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en" mlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <![endif]--> | |
<!--[if IE 7 ]> <html class="no-js ie7" lang="en" mlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <![endif]--> | |
<!--[if IE 8 ]> <html class="no-js ie8" lang="en" mlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <![endif]--> | |
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
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 | |
$deploy_json = @file_get_contents('php://input'); | |
if (!empty($deploy_json)) | |
{ | |
$deploy_data = json_decode($deploy_json); | |
//Log output to file (overwrites on each deploy). Make sure file is 0777 | |
file_put_contents('results.txt', print_r($deploy_data, 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
Instead of the "traditional": | |
(function() { | |
})(); | |
You can do: | |
!function(){ |
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
#!/bin/bash | |
# Find location of this script. | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
#Standard permissions | |
find "$DIR"/ -type d -print0 | xargs -0 chmod 775 | |
find "$DIR"/ -type f -print0 | xargs -0 chmod 664 | |
#Alternatively 0777 these |