This file contains hidden or 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
| defimpl Poison.Encoder, for: Timex.DateTime do | |
| use Timex | |
| def encode(d, _options) do | |
| fmt = DateFormat.format!(d, "{ISO}") | |
| "\"#{fmt}\"" | |
| end | |
| end |
This file contains hidden or 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/env python3 | |
| """Fixing bluetooth stereo headphone/headset problem in debian distros. | |
| Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197 | |
| Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone. | |
| This will be only fixes the bluez5 problem mentioned above . | |
| Licence: Freeware |
This file contains hidden or 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
| (module | |
| (func $addTwo (param i32 i32) (result i32) | |
| (i32.add | |
| (get_local 0) | |
| (get_local 1))) | |
| (export "addTwo" (func $addTwo))) |
This file contains hidden or 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 LeakyBucket.Bucket do | |
| @moduledoc """ | |
| Simulates a leaky bucket implementation | |
| """ | |
| use GenServer | |
| @initial_amount 0 | |
| @increment_rate 1 | |
| @leak_rate 2 | |
| @leak_interval 500 |
This file contains hidden or 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
| dialog { | |
| position: fixed; | |
| top: 50%; | |
| left: 50%; | |
| right: auto; | |
| padding: 30px; | |
| transform: perspective(500px) translate(-50%, -50%); | |
| background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF; | |
| border: none; | |
| border-radius: 3px; |
This file contains hidden or 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/env ruby | |
| # if limiting to one chapter, ./audiobook.rb 05 | |
| LIMIT = (ARGV[0] =~ /\A[0-9][0-9]\Z/) ? ARGV[0] : false | |
| BASE = Dir.pwd + '/' | |
| NUMS = BASE + 'ChapterNums/' | |
| DRUM = BASE + 'DrumFills/' | |
| GUIT = BASE + 'GuitarChords/' | |
| URLS = BASE + 'URLs/' |
This file contains hidden or 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 SqlParser do | |
| def run() do | |
| input = "select col1 from ( | |
| select col2, col3 from ( | |
| select col4, col5, col6 from some_table | |
| ) | |
| ) | |
| " | |
| IO.puts("input: #{inspect(input)}\n") | |
| IO.inspect(parse(input)) |
OlderNewer