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
package systextil.commons.io.path; | |
import java.io.File; | |
import com.sun.jna.Library; | |
import com.sun.jna.Native; | |
import com.sun.jna.NativeMapped; | |
import com.sun.jna.PointerType; | |
import com.sun.jna.win32.W32APIOptions; |
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
/** | |
* Regra de converção de moedas para o imposto de renda: | |
* | |
* Valor do dólar dos Estados Unidos da América, fixado pela autoridade monetária | |
* do país de origem dos rendimentos na data do recebimento. | |
* | |
* Em seguida convertido para reais pelo valor de compra do dólar fixado pelo Banco Central do Brasil | |
* para o último dia útil da 1a quinzena do mês anterior ao do recebimento dos rendimentos. | |
*/ |
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
defmodule Av4 do | |
def do_it() do | |
{:ok, buffer} = File.read("/Users/tiagoengel/Downloads/input-4.txt") | |
list = String.split(buffer, "\n") | |
|> Enum.drop(-1) | |
|> Enum.map(&transform_entry/1) | |
|> Enum.sort(&sort_entry/2) | |
result = traverse_events(list, nil, nil, %{}) |
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
/** | |
* Regra de converção de moedas para o imposto de renda: | |
* | |
* Valor do dólar dos Estados Unidos da América, fixado pela autoridade monetária | |
* do país de origem dos rendimentos na data do recebimento. | |
* | |
* Em seguida convertido para reais pelo valor de compra do dólar fixado pelo Banco Central do Brasil | |
* para o último dia útil da 1a quinzena do mês anterior ao do recebimento dos rendimentos. | |
*/ |
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
/** | |
* Small helper that keeps all running promises on a | |
* queue and allows a test to wait for all async code | |
* to finish before doing any assertions | |
*/ | |
const NativePromise = window.Promise | |
let queue = [] | |
class TestPromise extends NativePromise { |
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 | |
echo "MAKE SURE TO START bin/mojo before you run this script!" | |
JS_SPECS=$(git diff-tree --no-commit-id --name-only -r HEAD | grep '\.test\.js') | |
RUBY_SPECS=$(git diff-tree --no-commit-id --name-only -r HEAD | grep '_spec.rb' | sed -e ':a;N;$!ba;s/\n/ /g') | |
if [ "$RUBY_SPECS" != "" ]; then | |
bin/rspec $RUBY_SPECS | |
fi |
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
toggle(e) { | |
e.preventDefault(); | |
let wrapperHeight = this.refs.transitionWrapper.clientHeight; | |
if (this.state.expanded) { | |
this.setState({ expanded: false, submenuHeight: 0 })); | |
} else { | |
this.setState({ | |
expanded: true, | |
submenuHeight: wrapperHeight | |
}); |
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/bash | |
# You'll need to have sox, pavucontrol and alsa-utils installed, and the snd_aloop kernel module loaded. | |
# You can configure your system to load it on startup or load it manually with "sudo modprobe snd_aloop" | |
# Once this is script is running, you need to start recording audio in the application of your | |
# preference, open pavucontrol, go to the recording tab and change the recording source of that application | |
# to "Monitor of Loopback ..." | |
time=5 |