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
# Oto Brglez - <otobrglez@gmail.com> | |
echo 'public class Main {public static void main(String[] args){ System.out.println(System.getProperty("java.home"));}}' > /tmp/Main.java && \ | |
javac /tmp/Main.java && cd /tmp && java Main && rm Main.java && cd - |
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
#!/usr/bin/env bash | |
set -e | |
# Author: Oto Brglez, <otobrglez@gmail.com> | |
# "MY_PROJECT_HOME" - is environment variable, usually set with | |
# something like direnv (via .env) or let to developer | |
if [[ -z "${MY_PROJECT_HOME}" ]]; then | |
echo "MY_PROJECT_HOME environment variable is not set!" && exit 255 | |
fi |
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
#!/usr/bin/env bash | |
# Author: Oto Brglez | |
# Mail: otobrglez@gmail.com | |
# Version: 0.0.2 | |
# LICENCE: MIT | |
# Install: | |
# - https://pandoc.org/ | |
# - https://github.com/Wandmalfarbe/pandoc-latex-template | |
# - https://www.overleaf.com/learn/latex/XeLaTeX | |
# - https://github.com/be5invis/Iosevka |
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
// Live is to short to not have fun. | |
// Oto Brglez | |
// @otobrglez | |
object Main extends App { | |
type `🐰` = String | |
type `👨💼` = `🐰` | |
type `💯` = Int | |
val (`n🆕`: `🐰`, `s👽`: `🐰`) = ("\n", " ") | |
val `👋`: (`👨💼`, `🐰`) => `🐰` = { (`👶`, `🐇`) => |
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
# Single line of Ruby <3. | |
ruby -rjson -ryaml -e "puts YAML.load_file('my_file.yml').to_json" | |
# You can also pipe it to Python to get pretty ouput | |
ruby -rjson -ryaml -e "puts YAML.load_file('my_file.yml').to_json" | \ | |
python -mjson.tool | |
# Thats all. :) |
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 WebHookNode | |
has_many: :web_hook_expressions | |
has_many: :expression, thought: :web_hook_expressions | |
has_many :query_parameters, type: .... | |
has_many :body_parameters, type: .... | |
has_many :header_parameters, type: ... | |
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
package com.opalab.experimental | |
import java.io.File | |
import cats.data.NonEmptyChain | |
import cats.implicits._ | |
import io.circe.syntax._ | |
import scala.io.Source | |
import scala.util.Using |
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
# This method finds related articles using Jaccard index (optimized for PostgreSQL). | |
# More info: http://en.wikipedia.org/wiki/Jaccard_index | |
class Article < ActiveRecord::Base | |
def related(limit=10) | |
Article.find_by_sql(%Q{ | |
SELECT | |
a.*, | |
( SELECT array_agg(t.name) FROM taggings tg, tags t |
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
/** | |
* Author: Oto Brglez - <otobrglez@gmail.com> | |
*/ | |
package com.pinkstack.realestate.clustering4 | |
import akka.actor.typed._ | |
import akka.actor.typed.scaladsl._ | |
import akka.cluster.ClusterEvent.MemberEvent | |
import akka.cluster.typed._ | |
import com.monovore.decline._ |
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
#!/usr/bin/env ruby | |
# If you get "unknown OID 705: failed to recognize type of '<field>'. It will be treated as String." | |
# it probably means that type of column could not be identified when retriving records | |
# Example | |
User.where("'something' as something") | |
# Will results in unknown OID. However doing this: |