background preloader

Vimcasts - free screencasts about the text editor Vim

Vimcasts - free screencasts about the text editor Vim

IAmDann Ruby Programming Language ZSH-LOVERS(1) Mailpath: simple multiple mailpath: mailpath=($HOME/Mail/mbox'?new mail in mbox' $HOME/Mail/tux.u-strasbg'?new mail in tux' $HOME/Mail/lilo'?new mail in lilo' $HOME/Mail/ldap-fr'?new mail in ldap-fr') Mailpath: dynamic mailpath: Avoid globbing on special commands: for com in alias expr find mattrib mcopy mdir mdel which; alias $com="noglob $com" For migrating your bashprompt to zsh use the script bash2zshprompt located in the zsh source distribution under Misc. For migration from (t)csh to zsh use the c2z tool that converts csh aliases and environment and shell variables to zsh. Here are functions to set the title and hardstatus of an XTerm or of GNU Screen to zsh and the current directory, respectively, when the prompt is displayed, and to the command name and rest of the command line, respectively, when a command is executed: Put the following line into your ~/.screenrc to see this fancy hardstatus: caption always "%3n %t%? Special variables which are assigned:

GitHub - ctrlpvim/ctrlp.vim: Active fork of kien/ctrlp.vim—Fuzzy file, buffer, mru, tag, etc finder. Extending the Vim Language | Online Video Tutorial by thoughtbot Refresher on Vim Command Language We recommend going through our Onramp to Vim course on Vim's command language before this video, so that you're comfortable with the topics discussed in this video. Now let's build on the ideas from Onramp to Vim to use them to even better effect. Vim's command language The Vim language is the unique structure of key mappings in Vim such that we can almost treat it like a language. v: visually selecti: innerp: paragraph (Vim calls this a "text object") So vip is "visually select inner paragraph". c: changei: innerw: word We can use . to repeat this action as well, and Vim will "change a word" on any word the cursor is on. Custom verbs and nouns Sometimes we find that we don't have the right verb or noun for a change that we want to make. The Commentary Vim plugin gives us a new verb that comments things out. exchange.vim Exchange is for exchanging words, or any other text object. ReplaceWithRegister " Note, this must be nmap, not nnoremap nmap <leader>gr "*gr

Java Anti-Patterns This page collects some bad code that may not look so obviously bad to beginners. Beginners often struggle with the language syntax. They also have little knowledge about the standard JDK class library and how to make the best use of it. In fact I have collected all examples from everyday junior code. I have modified the original code to give it example character and such that it highlights the problems. Many of these problems can easily be detected by SonarQube. Some of these may seem like micro-optimization, premature optimization without profiling or constant factor optimizations. If you are interested in how to pogram compiler friendly, look at the JDK Performance Wiki. In the end a lot of your application's performance depends on the overall quality of your code. Compare these scenarios (assume 100MB young generation): In the slower scenario the transaction duration is 10 times longer. String concatenation This is a real memory waster. Lost StringBuffer performance String name = ...

6 reasons to use Pearltrees Pearltrees is the first and largest social curation community on the Internet. It’s a place to organize, discover and share all the cool content you find online. However, beyond this basic definition, a question remains: why would I want to use Pearltrees? Well, what I want to share with you are six major use cases (or reasons) we’ve identified as being most popular across our entire community of web curators. In addition, I’ll also share with you a couple of interesting ways in which I have put Pearltrees to use for myself. Hopefully, you’ll not only get value in learning how the community uses Pearltrees, but also be inspired to find even more clever and creative ways to use our software yourself. 3. The problem is that aside from searching your personal twitter stream to get back to the cool stuff you tweeted there’s no great way to keep those links at hand. Note: For advanced users you can even hashtag the links you tweet with #PT and the name of a pearltree in your account (e.g.

scrooloose/nerdtree dotphiles/dotsync: Sync dotfiles between multiple machines from a git repo or push using rsync Don't write on the whiteboard :: Joseph Perla I recently interviewed at a major technology company. I won't mention the name because, honestly, I can't remember whether I signed an NDA, much less how strong it was. I did well. 1. When I interviewed at Palantir around 5 years ago, I had a lot of trouble with this. Most people think you have to write on the whiteboard. The interviewer started by asking me to code up a simple recursive calculation, using any language I wanted. The interviewers don't care. 2. So I asked for some paper and a pen. You should always have paper and pen anyway to write down ideas. Some of the best programmers figure out the high-level overview on paper before they write a single line of new code. 3. Even if you are a C++ systems guru. You will waste a lot of time writing string manipulation code and initialization code that you can do in one line of Python. All I had was a post-it note, a tiny amount of space. 4. Five minutes later, I had my algorithm. 5. 6. Read random Wikipedia articles. 7. 8. 9. 10. 11.

Sinatra: README This page is also available in Chinese, French, German, Hungarian, Korean, Portuguese (Brazilian), Portuguese (European), Russian, Spanish and Japanese. Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort: # myapp.rb require 'sinatra' get '/' do 'Hello world!' Install the gem: And run with: View at: It is recommended to also run gem install thin, which Sinatra will pick up if available. Routes In Sinatra, a route is an HTTP method paired with a URL-matching pattern. get '/' do .. show something .. end post '/' do .. create something .. end put '/' do .. replace something .. end patch '/' do .. modify something .. end delete '/' do .. annihilate something .. end options '/' do .. appease something .. end link '/' do .. affiliate something .. end unlink '/' do .. separate something .. end Routes are matched in the order they are defined. Route patterns may include named parameters, accessible via the params hash: Or with block parameters: locals

rking/ag.vim susam/uncap: Map Caps Lock to Escape or any key to any key RESTful web services with MongoDB A few tutorials ago,in the tutorial about RestEasy and Hibernate, we saw how we could integrate RESTEasy with Hibernate.Now in this tutorial we will see how can we create Restful web services with RestEasy and MongoDB. As an example we will see how to expose the documents of collection named Categories.The service class will be: Since our service class is ready we now need to create the Application class: package com.javaonly.service; import java.util.HashSet; import java.util.Set; import javax.ws.rs.core.Application; public class CategoryApplication extends Application { private Set<Class<? Finally, in order to configure RESTEasy we must add the following snippet in the web.xml: Now every DAO class will extend AbstractDAO class.So in the case of categoryDAO we will have: package com.javaonly.mongo.daos; public class CategoryDao extends AbstractDao{ public CategoryDao(){ super(); } } As can see in the above class we've used a class named MongoDBUtil.

Related: