⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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 | |
function tirarAcento($string){ | |
$comAcento = array('à','á','â','ã','ä','å','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ù','ü','ú','ÿ','À','Á','Â','Ã','Ä','Å','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ñ','Ò','Ó','Ô','Õ','Ö','O','Ù','Ü','Ú','Ÿ','ª','º','+','*',"\"", "\\", "/"); | |
$semAcento = array('a','a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','u','u','u','y','A','A','A','A','A','A','C','E','E','E','E','I','I','I','I','N','O','O','O','O','O','O','U','U','U','Y','a','o','+','','','',''); | |
$novaString = str_replace($comAcento, $semAcento, $string); | |
return $novaString; | |
} | |
?> |
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
GRAPH API /fql ?q= { | |
"albuns":"SELECT aid FROM album WHERE owner = USER_ID", | |
"photos":"SELECT src_big FROM photo WHERE aid IN (SELECT aid FROM #albuns)" | |
} |
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 | |
$signed_request = $_REQUEST["signed_request"]; | |
list($encoded_sig, $payload) = explode('.', $signed_request, 2); | |
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); | |
if (empty($data["page"]["liked"])) { | |
echo "You are not a fan!"; | |
} else { | |
echo "Welcome back fan!"; | |
} |
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 | |
$HTML = ""; | |
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $HTML, $matches); | |
$first_img = $matches [1] [0]; | |
?> |
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
var map = function(value, istart, istop, ostart, ostop) { | |
return ostart + (ostop - ostart) * ((value - istart) / (istop - istart)) | |
}; |
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
https://www.facebook.com/dialog/pagetab?app_id=XXXXXXXXX&display=popup&next=HTTPURL |
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
<? | |
function list_collaborators() { | |
global $wpdb; | |
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name"); | |
foreach($authors as $author) { | |
$author_name = get_the_author_meta('display_name', $author->ID); | |
echo "<li>" . | |
"<a href=\"".get_author_posts_url( $author->ID, $author_name ). "\">" . | |
$author_name . |
This uses Twitter Bootstrap classes for CodeIgniter pagination.
Drop this file into application/config
.
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 | |
function truncate($value) { | |
$parts = explode('.',$value); | |
return $parts{0}; | |
} | |
function sum_the_time($time1, $time2) { | |
$seconds = 0; |
OlderNewer