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
{ "event": "unread_email", "type": "gauge", "value": "6", "ts": "2019-11-21T04:56:41Z" }{ "event": "chrome_tabs", "type": "gauge", "value": "22", "ts": "2019-11-21T04:56:41Z" }{ "event": "cpu_temp", "type": "gauge", "value": "137.3°F", "ts": "2019-11-21T04:56:41Z" }{ "event": "battery_remaining", "type": "gauge", "value": "Unlimited", "ts": "2019-11-21T04:56:41Z" }{ "event": "unread_email", "type": "gauge", "value": "6", "ts": "2019-11-21T04:57:16Z" }{ "event": "chrome_tabs", "type": "gauge", "value": "22", "ts": "2019-11-21T04:57:16Z" }{ "event": "cpu_temp", "type": "gauge", "value": "130.33°F", "ts": "2019-11-21T04:57:16Z" }{ "event": "battery_remaining", "type": "gauge", "value": "Unlimited", "ts": "2019-11-21T04:57:16Z" }{ "event": "unread_email", "type": "gauge", "value": "6", "ts": "2019-11-21T04:57:51Z" }{ "event": "chrome_tabs", "type": "gauge", "value": "22", "ts": "2019-11-21T04:57:51Z" }{ "event": "cpu_temp", "type": "gauge", "value": "134.94°F", "ts": "2019-11-21T04:57:51Z" }{ "event": "battery_re |
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
<script lang="ts"> | |
import Vue from "vue"; | |
import { mapActions } from "vuex"; | |
import router from "@/router"; | |
export default Vue.extend({ | |
name: 'callback', | |
data (): any { | |
this.handleAuthentication(); | |
router.replace('/'); |
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 isNumeric(n) { | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} | |
function MagicFunction(...numbers) { | |
let cache = numbers; | |
function magicFunction(...numbers) { | |
cache = cache.concat(numbers); |
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 Mapper do | |
def map(from, mapping) do | |
find_keys = Map.keys(mapping) | |
result = Map.new(find_keys, fn(key) -> | |
new_key = Map.get(mapping, key) || key | |
{ new_key, Map.get(from, key) } | |
end) |
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
# Questions: | |
# 1. How can I specify that path for the cached item by something other than the URL? | |
# 2. I'd like to use pieces in the Response to generate the cache location, but then, how do I check if the cached file exists before making the API call? | |
defmodule Base | |
use HTTPoison.Base | |
# ... Basic HTTPoison Implementation ... | |
end |
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
def new(conn, %{"podcast_slug" => slug}, current_user) do | |
with podcast <- find_podcast_for_user(slug, current_user.id), | |
changeset <- build_episode(podcast) do | |
render(conn, :new, changeset: changeset, podcast: podcast) | |
else | |
_ -> redirect(conn, to: page_path(conn, :index)) | |
end | |
end |
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
class BaseSort | |
def less(v : Comparable, w : Comparable) : Bool | |
return v < w | |
end | |
def exchange(a : Array(Comparable), i : Int, j : Int) | |
t = a[i] | |
a[i] = a[j] | |
a[j] = t | |
end |
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
# you prefer this ... | |
def this_function() do | |
IO.puts "Hello, World" | |
end | |
# over this ... | |
def this_function do | |
IO.puts "Better, World!" |
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
config :rumbl, Rumbl.Endpoint, | |
http: [port: 4000], | |
debug_errors: true, | |
code_reloader: true, | |
cache_static_lookup: false, | |
check_origin: false, | |
watchers: [ | |
{ :node, ["node_modules/.bin/watchify", "web/static/js/app.js", "-o", "priv/static/js/app.js", "--debug"] }, | |
{ :node, ["node_modules/.bin/sheetify", "web/static/css/index.css", ">", "priv/static/css/app.css"] } | |
] |
NewerOlder