Skip to content

Instantly share code, notes, and snippets.

View daltonjorge's full-sized avatar

Dalton Jorge daltonjorge

  • UFCG
  • Brazil - Paraiba - Campina Grande
View GitHub Profile
@daltonjorge
daltonjorge / rails_annotations.md
Created August 8, 2012 14:42 — forked from hakagura/rails_annotations.md
Explicações de conceitos do Rails e outras infos úteis.

Active Record

É um design pattern que o Rails implementa a partir da gem ActiveRecord.

Serve para conectar a camada Model da aplicação com tabelas do database, para assim criar um modelo de domínio persistível, onde a lógica (Model) e dados (BD) são apresentados em uma única solução.

Já persiste no BD:

obj.create
{
"cmd": ["groovy","$file"],
"windows":
{
"shell": "cmd.exe"
}
}
# An informative prompt that gives you hg and git repository info,
# as well as return code, RVM/rubenv info, and standard hostname, path, user.
# by Avery Yen <[email protected]>
#
# Hosted at <https://github.com/haplesshero13/my-tools>
#
# Requires hg-prompt <http://stevelosh.com/projects/hg-prompt/>
#
# Stolen mostly from <http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/>
# and alanpeabody.zsh-theme from Oh-My-Zsh.
# Shows little symbol '±' if you're currently at a git repo and '○' all other times
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
}
PROMPT='
%{$fg[blue]%}%n%{$reset_color%} on %{$fg[yellow]%}%m%{$reset_color%} in %{$fg[green]%}%~%b%{$reset_color%} $(hg_prompt_info)$(git_time_since_commit)$(check_git_prompt_info)
${vcs_info_msg_0_}$(prompt_char) '
@daltonjorge
daltonjorge / sampleREADME.md
Created August 21, 2018 20:28 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@daltonjorge
daltonjorge / README-Template.md
Created August 21, 2018 20:28 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@daltonjorge
daltonjorge / revert-a-commit.md
Created August 27, 2018 22:52 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@daltonjorge
daltonjorge / openssl_commands.md
Created November 19, 2018 13:24 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

openssl

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@daltonjorge
daltonjorge / build.gradle
Created April 22, 2019 13:31 — forked from orip/build.gradle
Print Gradle test results to console
/*
Sample output:
> gradle test ruby-1.9.3-p194 testing_with_gradle 9179829 ✗
...
:test
Results: SUCCESS (84 tests, 74 successes, 0 failures, 10 skipped)
*/
test {
testLogging {
@daltonjorge
daltonjorge / 149909-playlist_youtube.lua
Created August 13, 2019 16:36 — forked from Seneral/0 Warning.md
Modified VLC YouTube playlist parsing script to support playlists with more than 200 videos. Verified it works with 1000+ videos, no duplicates and all included (minus deleted videos). Official version claims to support 100+, but actually only works up until 200 videos. https://addons.videolan.org/content/show.php/+Youtube+playlist?content=149909
--[[
Youtube playlist importer for VLC media player 1.1 and 2.0
Copyright 2012 Guillaume Le Maout
Authors: Guillaume Le Maout
Contact: http://addons.videolan.org/messages/?action=newmessage&username=exebetche
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or