Skip to content

Instantly share code, notes, and snippets.

View schleumer's full-sized avatar
🔝
Writing bad code.

Wesley Schleumer de Góes schleumer

🔝
Writing bad code.
View GitHub Profile
@schleumer
schleumer / generateNumbers
Created March 12, 2013 00:51
Generate an array with $quantity random numbers from the given range (from $x to $y)
<?php
/**
* Generate an array with $quantity random numbers from the given range (from $x to $y)
* @param int $min
* @param int $max
* @param int $quantity
* @return array
*/
function generateNumbers($min, $max, $quantity) {
#!/bin/sh
X_NAME=$1
X_HOST="schleumer.com.br"
X_DEFAULT_VHOST="
<VirtualHost *:80>\n
ServerAdmin webmaster@$X_NAME.$X_HOST\n
ServerName $X_NAME.$X_HOST\n
DocumentRoot /var/www/$X_NAME\n
<Directory /var/www/$_XNAME>\n
@schleumer
schleumer / lefile.md
Last active April 14, 2021 07:24
My ArchLinux setup

Steps to set up a Arch Linux

Install vim <3

pacman -Syu

pacman -S vim

Create partition

fdisk /dev/sda

Format partition

Welcome to the Phusion Passenger Nginx module installer, v4.0.10.
This installer will guide you through the entire installation process. It
shouldn't take more than 5 minutes in total.
Here's what you can expect from the installation process:
1. This installer will compile and install Nginx with Passenger support.
2. You'll learn how to configure Passenger in Nginx.
3. You'll learn how to deploy a Ruby on Rails application.
# Cria um diretório de sources
mkdir ~/src
# Entra no diretório de sources
cd ~/src
# baixa a key do epel
wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
# importa a key do epel
<?php
class Octopus {
public $results = array();
public $urls = array();
public $chs = array();
public $mh = null;
public function __construct() {
#Add these commands to the file
echo "\n"
echo "********************"
echo "Post receive hook: Updating website"
echo "********************"
echo "\n"
#Change to working git repository to pull changes from bare repository
cd /home/topfriends/www || exit
unset GIT_DIR
<?php
class Users implements JsonSerializable{
private $_data = array();
public function addUser(User $user){
$this->_data[] = $user;
}
public function jsonSerialize(){
return $this->_data;
}
@schleumer
schleumer / sublime.reg
Last active September 21, 2016 18:58
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\sublime]
@="Adicionar diretório no &Sublime Text"
"Icon"="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\",0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\sublime\command]
@="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\" -a \"%V\""
[HKEY_CLASSES_ROOT\Directory\shell\sublime]
@schleumer
schleumer / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;