- Ceritifique-se de que o seu usuário do windows não tenha acentos no nome do diretório de usuário. Se tiver, retire assim: http://superuser.com/questions/495290/how-to-rename-user-folder-in-windows-8
- Tenha o virtualbox instalado
- Ter certeza de que o virtualbox consegue inicializar máquinas de 64bits (pode ter que alterar configurações de virtualização do windows - usei isso https://www.youtube.com/watch?v=rtF8nooLruY e isso https://www.youtube.com/watch?v=Y56boAsdptw)
- Abre o Power Shell ou o Cmder
- vagrant.exe box add --name rails http://files.hellobits.com/vagrant/hellobits-trusty64-virtualbox.box (using an already setted up box)
- vagrant plugin install vagrant-vbguest
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
require 'csv' | |
data = CSV.read('train.csv') | |
# puts 'Cabeçalho: ' + data[0].inspect | |
sobrev = [] | |
data.each do |r| | |
if r[1] == '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
public string InserirArquivoCliente(Usuario usr, string arq) | |
{ | |
string folderStr = ("{0}{1}").Concatenar("~/", usr.UsuarioPerfil.Empresa.IDEmpresa); | |
try | |
{ | |
using (IAmazonS3 client = AWSClientFactory.CreateAmazonS3Client("XXXXX", "XXXXXX", RegionEndpoint.SAEast1)) | |
{ | |
S3DirectoryInfo info = new S3DirectoryInfo(client, "XXXXXX"); | |
Stream a = new FileStream(arq, FileMode.Open, FileAccess.Read); |
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
// Modeline settings {{{ | |
// vim: foldmarker={{{,}}} foldlevel=0 foldmethod=marker | |
// }}} | |
<O arquivo em questão é um mini tutorial sobre como engendrar uma Autoridade Certificadora (AC), bem como gerar certicados e chaves via OpenSSL. Os exemplos são para serem executados em linha de comando UNIX/POSIX sua apresentação de forma de procedimentos é meramente para ilustrar a passagem de parâmetros.> | |
/*========================================================================*/ | |
<<< MINI-TUTORIAL>>> | |
<<< premissas> >> |
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 dir_watcher { | |
private $dir; | |
private $files; | |
public function __construct($dir = '.') { | |
$this->dir = realpath($dir) . DIRECTORY_SEPARATOR; | |
$this->get_file_timestamps(); |
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
using System; | |
using System.Collections.Generic; | |
using System.Collections; | |
using System.Web; | |
using System.Reflection; | |
namespace VetNuvem.Web.App_Code | |
{ | |
public class FormValidation | |
{ |
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
<? | |
exec("ssh -n -f us@hos \"sh -c 'nohup ./some_script_or_command > /dev/null 2>&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
javascript:function getCPF(){var n1 = Math.round(Math.random()*9);var n2 = Math.round(Math.random()*9);var n3 = Math.round(Math.random()*9);var n4 = Math.round(Math.random()*9);var n5 = Math.round(Math.random()*9);var n6 = Math.round(Math.random()*9);var n7 = Math.round(Math.random()*9);var n8 = Math.round(Math.random()*9);var n9 = Math.round(Math.random()*9);var aux = n1 * 10 + n2 * 9 + n3 * 8 + n4 * 7 + n5 * 6 + n6 * 5 + n7 * 4 + n8 * 3 + n9 * 2;aux = mod(aux, 11);var nv1 = aux < 2 ? 0 : 11 - aux;aux = n1 * 11 + n2 * 10 + n3 * 9 + n4 * 8 + n5 * 7 + n6 * 6 + n7 * 5 + n8 * 4 + n9 * 3 + nv1 * 2; aux = mod(aux, 11);var nv2 = aux < 2 ? 0 : 11 - aux;return ""+n1+n2+n3+"."+n4+n5+n6+"."+n7+n8+n9+"-"+nv1+nv2;}function mod(a,b){return Math.round(a-(Math.floor(a/b)*b));}javascript:$('#campoCpf').val(getCPF());$('#btnCriarUsuario').focus(); |
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
/** | |
* Espera até que algo ocorra para executar um callback | |
* | |
* @param t referência para função que testa a condição de continuidade | |
* @param v valor que a função de teste deve alcançar para que dê continuidade | |
* @param d intervalo de espera entre testes (milissegundos) | |
* @param c callback executado após condição alcançada | |
*/ | |
function waitFor(t, v, d, c) { | |
while (t() !== v) { setTimeout(function() { waitFor(t, v, d, c); }, d); return; } |
OlderNewer