$ rails g model User
belongs_to
has_one
#!/usr/bin/env bash | |
# Formatting constants | |
export BOLD=`tput bold` | |
export UNDERLINE_ON=`tput smul` | |
export UNDERLINE_OFF=`tput rmul` | |
export TEXT_BLACK=`tput setaf 0` | |
export TEXT_RED=`tput setaf 1` | |
export TEXT_GREEN=`tput setaf 2` | |
export TEXT_YELLOW=`tput setaf 3` |
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/bin/bash | |
# | |
# Tool to maintain p2 composite repositories | |
USAGE="Usage: | |
`basename "$0"` <repo-dir> [options] operation, operation ... | |
Options: | |
--name <repo name> | |
the repository name | |
--eclipse <eclipse install dir> |
#!/bin/sh | |
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do | |
last_commit_msg="$(git log --oneline --format=%f -1 $branch)" | |
if [[ "$(git log --oneline --format=%f | grep $last_commit_msg | wc -l)" -eq 1 ]]; then | |
if [[ "$branch" =~ "origin/" ]]; then | |
local_branch_name=$(echo "$branch" | sed 's/^origin\///') | |
if [[ -n "$EXEC" ]]; then | |
git push origin :$local_branch_name | |
else |
sudo ip addr add 192.168.0.183/24 dev eth0 #Configura o ip | |
ip route add default via 192.168.0.106 #Configura o proxy | |
sudo ip link set dev eth0 up #Sobe a interface | |
# Verificar o arquivo /etc/resolv.conf, deve conter as seguintes linhas | |
nameserver 8.8.8.8 | |
nameserver 8.8.4.4 | |
#Subir o postgres | |
su - postgres #Loga como superuser postgres |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>br.com.tasafo</groupId> | |
<artifactId>yoursite</artifactId> | |
<packaging>pom</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<properties> | |
<hostname>yoursite.com</hostname> |
import static com.google.common.collect.Iterables.toArray; | |
import static com.google.common.collect.Lists.newLinkedList; | |
import static java.util.Arrays.asList; | |
import java.util.Collection; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.widgets.Display; | |
import org.eclipse.swt.widgets.Shell; | |
import org.junit.rules.TestRule; |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
SELECT pg_terminate_backend(pg_stat_activity.procpid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = 'gruberdev' | |
AND procpid <> pg_backend_pid(); |