Acabei de descobrir o Gist.io, um serviço que permite compartilhar conteúdo de maneira bem peculiar, sem registro, sem burocracia, se você tiver uma conta no GitHub já está pronto para começar. A ideia é bem simples crie um gist público no GitHub, adicione qualquer conteúdo utilizando Markdown salve e pronto! Para visualizar e compartilhar seu post basta utilizar a seguinte url gist.io/ID-do-seu-gist
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
var sys = require('util'), | |
rest = require('restler'); | |
var baseurl = "<<instance URL>>/rest/v10" | |
// get oAuth token | |
var jsonData = {"grant_type":"password","username":"<<username>>","password":"<<password>>","client_id":"sugar"}; | |
rest.postJson(baseurl+'/oauth2/token', jsonData).on('2XX', function(data) { | |
if ( data.error ) { | |
sys.puts("Error: " + data.error_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
rand_str = ('a'..'z').to_a | |
('A'..'Z').to_a.each { |i| rand_str.push(i) } | |
9.downto(0) { |n| rand_str.push(n) } | |
rand_str.shuffle[0..9].join |
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 | |
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
function enqueue_my_styles() { | |
global $wp_styles; | |
// Load the main stylesheet | |
wp_enqueue_style( 'my-theme', get_stylesheet_uri() ); |
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
/** | |
* Solution to exercise 4.3 | |
* from Eloquent JavaScript Book, | |
* Chapter 4 - Exercise 4.3 | |
* | |
* http://eloquentjavascript.net/04_data.html | |
*/ | |
function arrayToList(arr) { | |
var list = null; |
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
Tux, | |
Git, | |
Apache Web Server, | |
MySQL, | |
Gnome, | |
Gnu, | |
Firefox, | |
KDE, | |
Blender, | |
X.Org, |
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 linux update, followed by GCC and Make | |
sudo yum -y update | |
sudo yum install -y gcc make | |
# Install Nginx and PHP-FPM | |
sudo yum install -y nginx php-fpm | |
# Install PHP extensions | |
sudo yum install -y php-devel php-mysql php-pdo \ | |
php-pear php-mbstring php-cli php-odbc \ |
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
.grid_12 | |
%h1 Contact | |
%h2 Want to get in contact, have a question or just fancy a chat? | |
%p Fill out the form below | |
%form{:action => "/contact", :method => "post"} | |
%div{:style => "margin:0;padding:0;display:inline"} | |
%label{:for => "contact_subject"} Subject: | |
%br | |
%input#contact_subject{:name => "subject", :size => "30", :type => "text"}/ |
curl http://exemplo.com.br --cookie-jar cookie | grep csrf
The --cookie-jar option creates a cookie in a file called "cookie" xD. This cookie is needed to validate the POST request
The command above will output something like this
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
# Start git-daemon to make local repositories available through network. | |
# see: https://www.kernel.org/pub/software/scm/git/docs/git-daemon.html | |
git daemon --verbose --export-all --base-path=/path/to/RepoSuperFolder |
OlderNewer