Skip to content

Instantly share code, notes, and snippets.

@tfnico
tfnico / logtree
Created July 18, 2013 09:23
This is a SVN repository of which I made a git svn clone. It's the output of git log --pretty=format:%h --graph --all
* ca2016c
| * e0c2cb7
| * c51b78f
| * 1ab694d
| * 32b2785
| | * d2cccc7
| | * 7f903ee
| | * 93afc10
| | * dd9b6c7
| | * 5fa6471
@tfnico
tfnico / Something.java
Created July 4, 2013 09:49
Sending a HTTP request with Java + Google Guava
public void sendMessage(String url, String params){
final HttpURLConnection connection;
try {
URL requestUrl = new URL(url);
connection = (HttpURLConnection) requestUrl.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Length", Integer.toString(params.getBytes().length));
connection.setRequestProperty("Content-Language", "en-US");
@tfnico
tfnico / console
Created February 20, 2013 09:00
git remote show
➜ ~/prefs/[master]✗>git remote show origin tfnico@Thomas-Ferris-Nicolaisens-iMac [10:00:02]
* remote origin
Fetch URL: [email protected]:tfnico/prefs.git
Push URL: [email protected]:tfnico/prefs.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
@tfnico
tfnico / podcast-app.md
Last active December 10, 2015 18:18
Which PodCast android app?

My criteria:

  • Coming from Listen
  • Google Reader integration would be nice
  • Cross-device sync would be nice
  • I've got an old weak samsung galaxy s, but also a powerful new nexus 10. An app that works great on both would be cool.

The candidates so far:

BeyondPod

@tfnico
tfnico / git-developers.md
Last active December 22, 2021 13:59
When and how to contact the Git developers

Before you send an email to the Git developers' mailing list

If you are a normal Git user, and you have problems using Git, you can also try:

If you believe you've found a bug in Git for Windows or msysGit (Windows-specific), first check their issue tracker to see if the problem has already been reported. If not, send a message to [email protected] or visit the online forum version.

@tfnico
tfnico / paste.md
Created October 26, 2012 11:14
Sharing your uncommitted changes using git instaweb
On Wednesday, October 24, 2012 11:14:55 PM UTC+2, Joe Cabezas wrote:
hello!

i want to show uncommited changes using git instaweb, but instaweb only shows commited changes...

i just want to show the git diff output to someone easy..., there is any alternatives to git instaweb?, thank you

Interesting question. With a little trickery, you can get instaweb to do what you want.

Here's an example, I'll say I'm working on a repository ~/projects/gitblit

@tfnico
tfnico / console.txt
Created October 4, 2012 11:17
how does ack work
➜ ~/projects/viaboxx-puppet/[master]✗>grep -r "site.erb" *
modules/apache2/manifests/init.pp: content => template("apache2/etc/apache2/sites-available/site.erb"),
➜ ~/projects/viaboxx-puppet/[master]✗>ack "site.erb"
➜ ~/projects/viaboxx-puppet/[master]✗>
# SOLUTION: By default, ack ignores unknown file types, including *.pp. This works:
➜ ~/projects/viaboxx-puppet/[master]✗>ack -a 'site.erb' -G '\.pp'
@tfnico
tfnico / report.txt
Created October 1, 2012 10:30
Failing coursera tests from week 1
Your overall score for this assignment is 8.74 out of 10.00
The code you submitted did not pass all of our tests: your submission achieved a score of
6.74 out of 8.00 in our tests.
In order to find bugs in your code, we advise to perform the following steps:
- Take a close look at the test output that you can find below: it should point you to
the part of your code that has bugs.
- Run the tests that we provide with the handout on your code.
- The tests we provide do not test your code in depth: they are very incomplete. In order
@tfnico
tfnico / whitechars.java
Created September 19, 2012 11:40
whitechars.java
public static ImmutableSet<Character> findInvalidChars(String name, ImmutableSet<Character> validCharSet) {
return Sets.difference(stringToCharSet(name), validCharSet).immutableCopy();
}
@tfnico
tfnico / guava.java
Created September 7, 2012 15:31
Some guava tests
@Test
public void validName() {
String name = "Thomas";
assertTrue(findInvalidChars(name, WhitelistCharacters.VALID_NAME_CHAR_SET).isEmpty());
}
@Test
public void invalidName() {
assertThat(findInvalidChars("<Thomas>", VALID_NAME_CHAR_SET), hasItems('<', '>'));
}