Skip to content

Instantly share code, notes, and snippets.

View mandado's full-sized avatar

Jorge Roberto Tomaz Junior mandado

  • Juiz de Fora - Minas Gerais
View GitHub Profile
@mandado
mandado / links.txt
Created January 24, 2014 19:23
links de node e git e gulp
#!/bin/sh
echo "-----------------------------------------------"
echo " Initial Configuration Ubuntu: By Mandado "
echo "-----------------------------------------------"
# System upgrade
echo "Updating repositories and upgrading system"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
clear
#!/usr/bin/env ruby
require 'mail'
mysql_username = 'root'
mysql_password = '123456'
mysql_database = 'test'
system("mysqldump --user=#{mysql_username} --password=#{mysql_password} #{mysql_database} > backup.sql")
# Credit to :
var getThumbYoutube = function(link, type) {
var _idVideo,_regExp = /(?:https?:\/{2})(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/;
var urls = {
"player": 'http://i1.ytimg.com/vi/{_videoid_}/0.jpg',
"normal": 'http://i1.ytimg.com/vi/{_videoid_}/default.jpg',
"medium": 'http://i1.ytimg.com/vi/{_videoid_}/mqdefault.jpg',
"high": 'http://i1.ytimg.com/vi/{_videoid_}/hqdefault.jpg',
"start": 'http://i1.ytimg.com/vi/{_videoid_}/1.jpg',
"middle": 'http://i1.ytimg.com/vi/{_videoid_}/2.jpg',
"end": 'http://i1.ytimg.com/vi/{_videoid_}/3.jpg',
# encoding: utf-8
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
- @categorias.each_slice(3) do |arr|
%ul.menu-categorias
- arr.each do |c|
%li
= link_to c.nome.capitalize,produtos_page_path(c.slug)
Lista* removerEl(Lista* l,int el){
Lista* p = l;
Lista* an;
while(p != NULL && p->num != el){
an = p;
p = p->prox;
}
#include <stdio.h>
#include <stdlib.h>
void mostrarMenu(){
printf("Selecione uma das opcoes abaixo\n");
printf("1) Incluir um elemento no final de uma lista.\n");
printf("2) Inserir um elemento numa posição determinada.\n");
printf("3) Concatenar duas listas.\n");
printf("4) Inverter uma lista de modo que o último elemento se torne o primeiro, e assim por diante.\n");
printf("5) Eliminar o último elemento de uma lista.\n");
Lista* InterseccaoLista(Lista* l,Lista* l2){
Lista* p;
Lista* k;
Lista* l3;
int num;
for(p = l;p != NULL;p = p->prox){
num = p->num;
for(k = l2;k != NULL;k = k->prox){
if(num == k->num){
l3 = insercao(l,k->num);
@mandado
mandado / testeestaticos.php
Created July 2, 2014 22:56
exemplo de classe com metodos estáticos
<?php
class minhaClasse{
public static function meuMetodo(){
echo 'meu nome';
}
}