Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Rodolfo Yabut rodocite

🎯
Focusing
View GitHub Profile
@rodocite
rodocite / .cs
Created Feb 11, 2020
Delete all occurrences of a given key in a linked list
View .cs
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;
}
}
View ets.ex
defmodule Users do
@users_json "./lib/ets.json"
def hydrate_ets do
@users_json
|> File.read
|> case do
{:ok, file} ->
file
@rodocite
rodocite / gist:99d470890658a1b1253830204afd0223
Last active Jun 16, 2017
This is why we need the pipe operator in every language.
View gist:99d470890658a1b1253830204afd0223
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))
View gist:a6908583a800c7b75f4436fd7b096850
klass = if Designer.where(email: resource_params[:email]).exists?
Designer
else
User
end
View init.coffee
# 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 ->
You can’t perform that action at this time.