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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
klass = if Designer.where(email: resource_params[:email]).exists? | |
Designer | |
else | |
User | |
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
list = [1, [[2], 3]] | |
list | |
|> List.flatten | |
|> Enum.reverse | |
|> Enum.map(fn(n) -> n * n end) | |
|> IO.inspect | |
IO.inspect(Enum.map(Enum.reverse(List.flatten(list)), fn(n) -> n * n 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
defmodule Users do | |
@users_json "./lib/ets.json" | |
def hydrate_ets do | |
@users_json | |
|> File.read | |
|> case do | |
{:ok, file} -> | |
file |
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
public class Solution { | |
public ListNode RemoveElements(ListNode h, int v) { | |
if (h == null) return null; | |
h.next = RemoveElements(h.next, v); | |
return h.val == v ? h.next : h; | |
} | |
} |