Skip to content

Instantly share code, notes, and snippets.

@davidsulc
davidsulc / sql_parser.exs
Created September 10, 2022 08:13 — forked from sasa1977/sql_parser.exs
Basic SQL parser developed at WebCamp Zagreb, 2019
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))
# http://adventofcode.com/2017/day/1
defmodule Day1B do
@input "3674367652242621474168763928218321697812856559411236481728359862138483975662842414677931192831838359723596864468766515959157341323361671711215775246919184575771292834762472643851621115394689224144952314841942625929178893862188633473449782316328138938985367593224673415356386123389495265762586841543231615548724281379842577974356198756373494496284686526372271276867483824444438576856848984298987816365577184736265615337226594546412866841243924896693939876544617185514454428546351725874981373131436594737254881143464638159527317298246614224847423876255485865467941541869347851264186416839872219963877566774497794118377249453868539886234416452144611592552853449178872844866845534958897244329539138538955178328941734982338332474841168919821932999666675225181556252275937454265296914769641966991453458673243691279851969772258679574637169733841671684221431339322858741339953471639498418394312337551781962283797279643116626464643289347855765938779557323488914189731
defmodule Day1 do
@input "367436765224262147416876392821832169781285655941123648172835986213848397566284241467793119283183835972359686446876651595915734132336167171121577524691918457577129283476247264385162111539468922414495231484194262592917889386218863347344978231632813893898536759322467341535638612338949526576258684154323161554872428137984257797435619875637349449628468652637227127686748382444443857685684898429898781636557718473626561533722659454641286684124392489669393987654461718551445442854635172587498137313143659473725488114346463815952731729824661422484742387625548586546794154186934785126418641683987221996387756677449779411837724945386853988623441645214461159255285344917887284486684553495889724432953913853895517832894173498233833247484116891982193299966667522518155625227593745426529691476964196699145345867324369127985196977225867957463716973384167168422143133932285874133995347163949841839431233755178196228379727964311662646464328934785576593877955732348891418973131584576371422383153278774939949335141
@davidsulc
davidsulc / 1_WTF.md
Last active August 29, 2015 14:07 — forked from valpackett/1_WTF.md

Kindle dictionary template

Use it with KindleGen

kindlegen dic.opf

@davidsulc
davidsulc / i18n.coffee
Created March 15, 2012 11:49 — forked from madrobby/i18n.coffee
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
@davidsulc
davidsulc / gist:1533326
Created December 29, 2011 10:11
First steps with Popcorn.js
<!-- the demo can be found at ap-popcorn-demo.heroku.com -->
<!doctype html>
<html>
<head>
<script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<style type="text/css">
/* CSS grid from foundation.zurb.com */
/* Arfully Masterminded by ZURB */