This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import smbus | |
import time | |
def convert_coefficient(msb, lsb, total_bits, fractional_bits, zero_pad): | |
data = (msb << 8) | lsb | |
period = float(1 << 16 - total_bits + fractional_bits + zero_pad) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[no project] tmp $ set VERBOSE true | |
[no project] tmp $ new-project --named example --topLevelPackage com.example --type war --projectFolder example | |
Wrote /tmp/example/pom.xml | |
***ERROR*** Exception encountered: (type "set VERBOSE false" to disable stack traces) | |
org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective model for org.jboss.forge.generated:generated-pom:1.0.0-SNAPSHOT | |
[ERROR] Invalid artifact repository: null @ | |
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:422) | |
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:374) | |
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:365) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"------------------------------------ | |
"root settings | |
"------------------------------------ | |
"colorscheme desert | |
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$" | |
set fileencodings=ucs-bom,utf-8,latin1 | |
endif | |
set nocompatible " Use Vim defaults (much better!) | |
set bs=indent,eol,start " allow backspacing over everything in insert mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text/html; w3m %s; nametemplate=%s.html | |
text/html; w3m -dump %s; nametemplate=%s.html; copiousoutput | |
image/jpg; eog %s | |
image/jpeg; eog %s | |
image/png; eog %s | |
image/gif; eog %s | |
application/pdf; evince %s | |
application/zip; file-roller %s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONTENT_TYPE; | |
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.OK; | |
import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1; | |
import java.net.InetSocketAddress; | |
import java.nio.charset.Charset; | |
import java.util.concurrent.Executors; | |
import junit.framework.Assert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = USER_NAME | |
email = MAIL_ADDRESS | |
[alias] | |
st = status | |
co = checkout | |
cb = checkout -b | |
# ci = commit -a # modifiedなファイルを全てstageへ | |
br = branch | |
glog = log --pretty=format:\"%C(red)%h%Creset %C(cyan)<%an>%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset\" --abbrev-commit --date=relative --graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# extract a jar file and replace the original jar file. | |
# usage) | |
# extractjar.sh [-f] xx.jar | |
# -f: don't keep backup file. | |
if [ $1 = "-f" ]; then | |
shift 1 | |
else | |
cp $1 $1.bkp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OpMock { | |
public void createProvider() throws IOException { | |
Map<String, String> prop = new HashMap<String, String>(); | |
prop.put("webroot", "test-resources"); | |
prop.put("httpPort", "28080"); | |
Launcher.initLogger(prop); | |
final Launcher winstone = new Launcher(prop); | |
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set NSPR_LOG_MODULES=nsHttp:4 | |
set NSPR_LOG_FILE=C:\TEMP\mozilla\log.txt | |
if not exist "C:\TEMP\mozilla" mkdir "C:\TEMP\mozilla" | |
cd "\Program Files\Mozilla Firefox" | |
firefox -P WebTest -no-remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:Todo() | |
call s:OpenBufferFromCommand('ditz todo', function('s:IssueCallback')) | |
endfunction | |
function! s:TodoAll() | |
call s:OpenBufferFromCommand('ditz todo --all', function('s:IssueCallback')) | |
endfunction | |
function! s:Grep(args) | |
call s:OpenBufferFromCommand(printf('ditz grep "%s"', a:args), function('s:IssueCallback')) |