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
<?php
class Users implements JsonSerializable{
private $_data = array();
public function addUser(User $user){
$this->_data[] = $user;
}
public function jsonSerialize(){
return $this->_data;
}
#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 Octopus {
public $results = array();
public $urls = array();
public $chs = array();
public $mh = null;
public function __construct() {
# 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
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.
@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

#!/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 / 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) {