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
| #put oids in here | |
| oids = %w( | |
| ) | |
| orders = Order.where(id: oids).where(status: 'canceled_by_seller_review'); | |
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
| #!/bin/sh | |
| while : | |
| do | |
| zone=$(sonos list-zones 2>&1 | head -n 1) | |
| sonos-cli --zone $zone volume [0] | |
| sonos-cli --zone $zone stop | |
| sleep 1 | |
| done |
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
| git branch | grep -v master | xargs -n 1 git branch -D | |
| git brach list branches | |
| grep -v is a filter | |
| xargs -n 1 pass in the arguments | |
| git branch -D is the command. |
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 Array do | |
| def sum([]) do | |
| 0 | |
| end | |
| def sum([ head | tail ]) do | |
| head + sum(tail) | |
| 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
| fizzbuzz = fn | |
| 0, 0, _ -> "FizzBuzz" | |
| 0, _, _ -> "Fizz" | |
| _, 0, _ -> "Buzz" | |
| _, _, n -> n | |
| end | |
| fb = fn | |
| n -> fizzbuzz.( rem(n,3) , rem(n,5) , n) |> IO.puts | |
| end |
Here's a live demo http://dogdash.herokuapp.com/
Code example: https://github.com/bennycwong/dogdash
Dashing widget to display a random gif from reddit