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
#include <iostream> | |
#include <list> | |
using namespace std; | |
int main() | |
{ | |
list<int> numeros; | |
list<int>::iterator item; | |
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/env ruby | |
require 'yaml' | |
DOUBLED = /aa|bb|cc|dd|ee|ff|gg|hh|ii|jj|kk|ll|mm|nn|oo|pp|qq|rr|ss|tt|uu|vv|ww|xx|yy|zz/i | |
names = [ | |
"Aber&Crombie", "Apple", "BMW", "Boss", "Burger King", "Carlsberg", "Caterpillar", | |
"Coca-cola", "Dior", "Disney", "Ebay", "Emirates", "Google", "IBM", "Ikea", "Kodak", | |
"Lacoste", "Lenovo", "Levi’s", "L’oréal", "Michelin", "Mittal", "Monsanto", "Nestlé", "Nike", | |
"Nikon", "Nutella", "Pampers", "Pfizer", "Philips", "Procter&Gamble", "Redbull", |
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/sh | |
USERNAME="username" | |
PASSWORD="password" | |
SERVER="hostname or ip here" | |
# Directory where file is located | |
DIR="/some/directory" | |
# Filename of backup file to be transfered | |
FILE="filename" | |
# login to ftp server and transfer file | |
cd $DIR |
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> | |
<html> | |
<head> | |
<meta name="description" content="mcorp template" /> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> |
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
// BASE | |
- Addict ... add<IParceiro>() : where new() | |
public T FindBy<T>(int id) where T : IParceiro { | |
var p = Addict.Create<T>() { .... props .... } | |
return p | |
} |
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
# This file should be placed at /etc/logrotate.d/ | |
/srv/*/shared/log/*.log { | |
daily | |
missingok | |
dateext | |
rotate 30 # amount of days to keep compressed logs (you should backup it up externally) | |
compress | |
delaycompress | |
notifempty |
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 static class FileDialogExtension | |
{ | |
internal class SapMainWindow : IWin32Window | |
{ | |
[DllImport("user32.dll")] | |
private static extern IntPtr GetForegroundWindow(); | |
public IntPtr Handle { get { return GetForegroundWindow(); } } | |
} |
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
git diff --diff-filter=AM --name-only origin/master |grep '\.rb' |xargs --no-run-if-empty bundle exec rubocop |
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
elementos = %w(sub_grupo loja setor grupo fornecedor) | |
# => ["sub_grupo", "loja", "setor", "grupo", "fornecedor"] | |
elementos.sort | |
# => ["fornecedor", "grupo", "loja", "setor", "sub_grupo"] | |
indice = { loja: 0, fornecedor: 1, setor: 2, grupo: 3, sub_grupo: 4 } | |
# => {:loja=>0, :fornecedor=>1, :setor=>2, :grupo=>3, :sub_grupo=>4} | |
elementos.sort{|a,b| indice[a.to_sym] <=> indice[b.to_sym] } |
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
# | |
# Thanks to Glauco Vinicius who teached this to me | |
# | |
# | |
# our little lambda that evaluates if a number is even or odd | |
# | |
IsEven = { x | (x % 2) == 0 } | |
# |
OlderNewer