Skip to content

Instantly share code, notes, and snippets.

@thisivan
thisivan / find_command_samples.sh
Created May 14, 2009 05:04
Some find bash command samples
# Find text in files
find | xargs grep 'text to find' -l
# Find and exec command
find -name '*.bak' -exec rm {} \;
# Find only dirs
find -type d
# Find only files
@mpen
mpen / ApacheHttpClientGet.scala
Created October 29, 2009 05:39
Apache HttpComponents HttpClient Get
// Apache HttpComponents HttpClient Get
import java.io.{ File, IOException }
import java.net.{ URI, UnknownHostException, URLDecoder }
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.client.methods.HttpGet
import org.apache.http.{ HttpResponse, HttpEntity, HttpStatus }
import org.apache.http.util.EntityUtils
import org.apache.commons.io.{ FileUtils, FilenameUtils }
@Superbil
Superbil / make-xcode-ignore.sh
Created September 25, 2010 11:40
auto make xcode ignore file script
#!/bin/bash
## call git init
git init
## make .gitignore
cat > .gitignore << EOF
# Mac OS X Finder and whatnot
.DS_Store
# no useful files
@ryoasai
ryoasai / gist:946477
Created April 28, 2011 14:43
Spring TypeDescriptor test.
package com.github.ryoasai;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@tekei
tekei / gist:3290956
Created August 8, 2012 00:40
icloudに格納したメモ帳をテキストファイルとしてダウンロードする
# -*- coding: utf-8 -*-
# icloudに格納したメモ帳をテキストファイルとしてダウンロードする
# ファイル名は、[更新日付-タイトル.txt]
require 'mail'
require 'cgi'
account = '(ユーザ名)@me.com'
pass = '(パスワード)'