Skip to content

Instantly share code, notes, and snippets.

View caiolima's full-sized avatar

Caio Lima caiolima

  • Jusbrasil
  • Salvador, BA - Brazil
View GitHub Profile
@caiolima
caiolima / FieldsIteratorIteration.java
Last active November 14, 2019 12:43
DateFormat Fields Iteration
public class DateFormatTest extends TestFmwk {
// ...
public void test20741_ABFields() {
ULocale locale = ULocale.forLanguageTag("en-001");
DateTimePatternGenerator gen = DateTimePatternGenerator.getInstance(locale);
String pattern = gen.getBestPattern("EEEEEBBBBB");
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale);
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("PST8PDT"));
calendar.setTime(new Date(0));
for (let i = 0; i < wordList.length; i++) {
#specialize(0, 2, 3)
let findPos = searchInText(textTokenized, wordList[i], 1, 4);
print("Found \"" + wordList[i] + "\" in text in following positions:");
for (let pos of findPos)
print(findPos);
}
@caiolima
caiolima / solarized.vim
Created May 25, 2017 14:33
Solarized vom color scheme
" Name: Solarized vim colorscheme
" Author: Ethan Schoonover <es@ethanschoonover.com>
" URL: http://ethanschoonover.com/solarized
" (see this url for latest release & screenshots)
" License: OSI approved MIT license (see end of this file)
" Created: In the middle of the night
" Modified: 2011 May 05
"
" Usage "{{{
"
@caiolima
caiolima / gist:d7c538fa936dc62ed3cd7841bbe04dc3
Created March 6, 2017 01:15
Running JSC on test262-harness
First you need to build JSC. Since it is a module in WebKit, you can follow these instructions to get the code and learn how to build it.
https://webkit.org/getting-started/#building-webkit
After the machine setup, you can build JSC as a stand-alone CLI program running
```<path_to_webkit>/Tools/Scripts/build-jsc —release```
It will build jsc into ```<path_to_webkit>/WebKitBuild/Release```
@caiolima
caiolima / Vagrantfile-xv6-vfs
Created December 30, 2015 00:28
Standert Vagrantfile to run the xv6 with VFS implementation
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "caiolima/xv6-vfs"
end
@caiolima
caiolima / Vimrc
Last active May 25, 2017 14:29
caiolima's Vim Configuration for Rails and Python development
set tabstop=2
set shiftwidth=4
set softtabstop=4
set nowrap
set expandtab " expand tabs to spaces
set smarttab
set hidden
set autoread " reload files when changed on disk, i.e. via `git checkout`
set backspace=2 " fix broken backspace in some setups