A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
#!/bin/bash | |
FILE="$1" | |
TMP_FILE="$FILE.tmp" | |
if [ -f "$FILE" ]; then | |
IS_ISO=$(file -I "$FILE" | grep 8859) | |
if [ -n "$IS_ISO" ]; then | |
iconv -f iso-8859-1 -t utf-8 "$FILE" > "$TMP_FILE" |
PROMPT=$' | |
%{$fg[white]%}%n@%m%{$reset_color%} %{$fg[blue]%}[%/]%{$reset_color%} $(git_prompt_info)$(bzr_prompt_info) | |
%{$fg_bold[black]%}\$%{$reset_color%} ' | |
PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" | |
GIT_CB="git::" | |
ZSH_THEME_SCM_PROMPT_PREFIX="%{$fg[green]%}[" | |
ZSH_THEME_GIT_PROMPT_PREFIX=$ZSH_THEME_SCM_PROMPT_PREFIX$GIT_CB | |
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " |
#!/bin/bash | |
title="$1" | |
message="$2" | |
param='display notification "'$2'" with title "'$1'"' | |
osascript -e "$param" | |
# Usage: alertme "Title" "Message" |
#!/usr/bin/env python2 | |
# | |
# This script will run something every 2 seconds and print a line in between | |
# | |
# Usage: intrun command | |
from subprocess import call | |
from sys import argv, exit | |
from time import sleep |
Available packages (APT): | |
r-base | |
r-cran-ggplot2 | |
r-cran-lme4 | |
r-cran-reshape | |
r-cran-xml | |
CRAN only: |
ntpdate 0.br.pool.ntp.org |
# prompt style and colors based on Steve Losh's Prose theme: | |
# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme | |
# | |
# vcs_info modifications from Bart Trojanowski's zsh prompt: | |
# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt | |
# | |
# git untracked files modification from Brian Carper: | |
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt | |
PR_GIT_UPDATE=1 |
<?php | |
$idade = trim($_POST['idade']); | |
$erro = false; | |
if (empty($idade)) { | |
$erro = 'Idade não pode ser vazia'; | |
} elseif (! is_numeric($idade)) { | |
$erro = 'Idade deve ser numérica'; | |
} elseif ($idade < 18) { |
A list of amazingly awesome PHP libraries, resources and shiny things.
var MyClass = function () { | |
this.name = ""; | |
this.setName = function (name) { | |
this.name = name; // Este this é o MyClass, não a function atual | |
}; | |
this.getName = function () { | |
return this.name; | |
}; | |
this.keyPressSetter = function (k) { | |
this.name = this.name + String.fromCharCode(k.keyCode); |