Docs - Element/Element The following functions are treated as Window methods. Function: document.id The document.id function has a dual purpose: Getting the element by its id, and making an element in Internet Explorer "grab" all the Element methods. Syntax: var myElement = document.id(el); Arguments: el - The Element to be extended. Returns: (element) A DOM element. Examples: Get a DOM Element by ID: var myElement = document.id('myElement'); Get a DOM Element by reference: var div = document.getElementById('myElement'); div = document.id(div); // the element with all the Element methods applied. Notes: This method is useful when it's unclear if working with an actual element or an id. Function: $ The dollar function is an alias for document:id if the $ variable is not set already. var myElement = $('myElement'); var myElement2 = document.id('myElement'); myElement == myElement2; // returns true (function($){ // Now you can use $ safely in this closure })(document.id) See Also: MooTools Blogpost: The Dollar Safe Mode Note:
git command-line usage cheatsheet/quickref master TOC | chapter TOC | license This document describes stuff that's not necessarily done every day. The bare minium stuff like git add/commit/push/checkout/branch etc is not covered. setting up I strongly recommend these settings to make life easier. bash aliases for git alias g='git --no-pager' alias gp='git -p' alias mg='git help' most useful stuff in $HOME/.gitconfig My .gitconfig is here . stuff you tend to forget add and commit # stage updates/deletes for files git already knows about git add -u [paths...] # ditto for ALL files, including new ones git add -A # stage updates/deletes for files git already knows about AND COMMIT git commit -a push don't forget to git push --tags when needed diff # diff between work area and stage git diff # diff between work area and repo (CVS model) # note that "git diff" + "git diff --cached" == "git diff HEAD" git diff HEAD # other coolness git diff "@{yesterday}" conflicts on pull/merge log pickaxe and blame misc oopsies! screwed up commit? useful commands
Dicas Locaweb » Blog Archive » Git – Dicas e truques No dia-a-dia utilizar recursos das ferramentas certas ajudam a agilizar nosso trabalho, tratando-se de controle de versões o Git tem diversos truques interessantes. Vou resumir de forma rápida alguns comandos que utilizo diariamente, a idéia é concentrar aqui novas dicas que forem aparecendo, então sugestões são bem vindas. Um dos comandos mais úteis e interessantes que tenho utilizado ultimamente para fazer revisão de código ou para ter um histórico do projeto é o “instaweb” que inicia um servidor local onde podemos navegar ( pelos commits e verificar as diferenças do repositório de uma forma bem simples e clara. É importante lembrar que ao subir o serviço o terminal fica liberado sendo necessário parar o servidor após o uso senão o processo continuará “rodando”. git instaweb --httpd webrick git instaweb --httpd webrick --stop git stash git stash apply git commit -m "Alguma mensagem errada" git commit --amend -m "Correção da mensagem"
Developer Network piecemeal staging committed 15 Jan 2009 This is a follow up to the comments from yesterday’s article about interactive adding . Readers were begging coverage of powerful git add -p , a shortcut to the patch mode of interactive adding. This command is capable of breaking up changes in files into smaller hunks so you can commit exactly what you want, and not just the whole file. This behavior is very helpful since it allows you to version any “hunk” of text in the file that you’d like. Perhaps that one line of code will break the build on others’ machines or the build server, but just not yours. Let’s go through an example of using it, making changes to our project’s trusty README file again. diff --git a/README.md b/README.md index 2556dae..45d8b6e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,14 @@ > There is only one way... > ~ Henry Van Dyke +# Project information + +Blah blah blah... + # Want to contribute? So as we can see, we’ve made changes in separate parts of the file. git add -p
Gitorious Propel ORM 1.5 User Guide ¶ Everything you need to get started - from installation and setup to advanced object model. What's New in Propel 1.5 Users of previous versions can check the changes here. Changelog Updates in the 1.5 branch since the release of 1.5.0 stable Project Setup ¶ Installing Propel Install Propel using PEAR, SVN or a tarball. Building A Project Generate PHP model based on a XML schema Using Propel ¶ Basic CRUD The basics of Propel CRUD (Create, Retrieve, Update, Delete) operations Relationships How to access related rows in Propel. Validators How to use Propel's validation framework. Transactions Some tips on how to use transactions with Propel. Behaviors How to package and reuse common model features. nested_set soft_delete sluggable timestampable sortable concrete_inheritance , documented in the Inheritance Chapter even though it's a behavior aggregate_column query_cache auto_add_pk alternative_coding_standards User-contributed behaviors Reference ¶ Runtime Configuration Tweak the runtime-conf.xml
git-reset git-reset The Git subcommand git-reset is very frequently used, and is one of very few commonly-used Git commands that can permanently destroy real work. Once work is in the repository, it is almost completely safe from any catastrophe. But git-reset also affects the working tree, and it is quite possible to utterly destroy a day's work by doing git-reset --hard at the wrong time. working index HEAD target working index HEAD ---------------------------------------------------- A B C D --soft A B D --mixed A D D --hard D D D --merge (disallowed) working index HEAD target working index HEAD ---------------------------------------------------- A B C C --soft A B C --mixed A C C --hard C C C --merge (disallowed) Six more of these tables follow, giving the impression that git-reset is quite complicated. The thing to notice about the two tables I quoted above is that they are redundant, because the second one is simply a special case of the first, with D replaced by C .
Blog do Grasselli: Como eu uso o GIT Antes de mais nada, gostaria de dar os devidos créditos ao @rogerio_augusto porque foi ele quem me ensinou boa parte dos itens que vou escrever hoje. Pull e Push Bom, vou começar pelo mais básico, enviar e receber commits do repositório remoto. Geralmente o pessoal acredita que a fórmula é essa: commito alguma coisafaço pull para ver se tem alguma coisa no remotofaço push para enviar para ele Isso até que funciona, mas eu prefiro uma outra abordagem que deixa a árvore dos commits mais organizada. O pull nada mais é do que um fetch (baixa objetos e referências do remoto) mais merge (junta duas ou mais histórias). Imagine que você baixou tudo que estava no remoto e fez um commit. Para não ter que criar um repositório remoto para o exemplo, eu fiz o merge entre dois repositórios locais, mas o resultado é o mesmo. Com o merge ele mostra que os commits foram feitos em paralelo, mas as vezes essa informação não é tão relevante, e vale mais a pena deixar a árvore organizada. git fetch Viram? git add .
Manuel PHP Git FAQ What is Git? Git is a distributed version control system developed by Junio Hamano and Linus Torvalds. Git does not use a centralized server. Git runs on Linux, BSD, Solaris, Darwin, Windows, Android and other operating systems. Why the 'Git' name? Quoting Linus: "I'm an egotistical bastard, and I name all my projects after myself. ('git' is British slang for "pig headed, think they are always correct, argumentative"). Alternatively, in Linus' own words as the inventor of Git: "git" can mean anything, depending on your mood: Random three-letter combination that is pronounceable, and not actually used by any common UNIX command. How do I report a bug in Git? Bug reports can be sent to the Git mailing list: git@vger.kernel.org Please put "[BUG]" in the subject line. What's the difference between fetch and pull? The short definition is: Fetch: Download (new) objects and a head from another repository. Pull: Fetch (as defined above), and then merge what was downloaded with the current development. No.
Configurando o Terminal no Mac OS X Se você passa muito tempo usando o Terminal do Mac OS X, veja algumas dicas de como personalizar e melhorar sua produtividade. Arquivos de configuração O Terminal carrega um arquivo chamado .bash_profile toda vez que uma nova aba é aberta. cd $HOME cd ~ cd Nós iremos editar o arquivo $HOME/.bash_profile. Cores O primeiro passo é adicionar cores à saída do Terminal. export GREP_OPTIONS="--color=auto" export GREP_COLOR="4;33" export CLICOLOR="auto" alias ls="ls -G" Essas configurações irão tornar o comando ls e grep coloridos, como no exemplo abaixo. Como você pode perceber, as cores não ficaram muito boas. Depois de instalar o SIMBL, baixe o bundle TerminalColours. Abra as preferências. Se preferir, baixe o arquivo IR_Black.terminal e dê um duplo clique para adicioná-lo. Seu Terminal ficará parecido com isso. Atalhos de Teclado O Terminal possui uma série de atalhos como Ctrl+E para ir ao fim da linha e Ctrl+A para ir ao começo. Faça a mesma coisa para a opção “control cursor right”. E agora?
S'informer sur Pyromaths, un générateur de fiches d’exercices Jerome, le 26.05.10 Cet article est très nettement inspiré de cet article. La raison de ce changement de stratégie est la suivante : si un bug est découvert, il n’y a pas moyen de récupérer le code source corrigé sur le dépôt Git si de nouvelles fonctionnalités ont été ajoutées entre temps. De même, si le développeur 1 travaille sur un exercice 1 et le développeur 2 sur un exercice 2, il n’est pas possible de sortir une version ne contenant que l’exercice 1 si l’exercice 2 n’est pas fini. Git permet de gérer les branches. La branche master Personne ne devrait travailler sur la branche master. La branche develop Cette branche contient les nouveautés abouties. Créer une branche pour une nouvelle fonctionnalité Quand on commence à travailler sur une nouvelle fonctionnalité, on crée une branche pour celle-ci en local : git checkout -b aires-6e develop On se retrouve alors dans cette branche et on peut travailler l’esprit tranquille. incorporer la nouvelle fonctionnalité dans la branche develop