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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js"></script> | |
<style type="text/css"> | |
* { font-family: Verdana; font-size: 96%; } | |
label { width: 10em;} | |
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; } |
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 | |
cp -rfv /etc/zypp/repos.d /etc/zypp/repos.d.old | |
sed -i 's/11.4/12.1/g' /etc/zypp/repos.d/* | |
zypper ref && zypper dup |
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
/*Com JQuery */ | |
if( $('#id_do_elemento').length ) { | |
//Codigo | |
} | |
/* metodo tradicional sem JQuery */ | |
if(document.getElementById('id_do_elemento') != null) | |
{ | |
//Codigo | |
} |
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
$app->post('/api/authenticate/authorize/', function() use($app) { | |
$data = $app['request']->get('data'); | |
print_r(array('data' => $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 | |
if(isset($_FILES["source"]["name"])) | |
{ | |
try { | |
$facebook->setFileUploadSupport(true); | |
$response = $facebook->api( | |
'/me/photos/', | |
'post', | |
array( | |
'message' => $_POST['message'], |
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
# install xcode via App Store first! It takes awhile | |
# install the command-line tools as well | |
# install growl from App Store | |
# eclipse/android | |
open http://www.eclipse.org/downloads/packages/eclipse-classic-42/junor | |
open http://developer.android.com/tools/sdk/eclipse-adt.html | |
# homebrew |
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 | |
function post_type_dir( $param ){ | |
$screen = get_current_screen(); | |
$mydir = '/'.$screen->post_type; | |
$param['path'] = $param['path'] . $mydir; | |
$param['url'] = $param['url'] . $mydir; | |
return $param; | |
} |
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 | |
function wp_restrict_editing( $allcaps, $cap, $args ) { | |
//Only for non Admin users | |
if(!current_user_can('administrator')) { | |
// Load the post data: | |
$post = get_post( $args[2] ); | |
// Bail out if the post isn't published' | |
if( 'publish' != $post->post_status) | |
return $allcaps; | |
} |
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
# Make sure these directives are either above the "BEGIN WordPress" | |
# line or below the "END WordPress" line. Also, make sure you test | |
# your site if you use any of the suggestions below. These rules | |
# are very specific to running WordPress so if you also serve some other | |
# static or PHP files under the directory where these rules will live | |
# you may find they won't work. TEST TEST TEST. | |
# disable directory browsing | |
Options All -Indexes | |
OlderNewer