Skip to content

Instantly share code, notes, and snippets.

View Koroeskohr's full-sized avatar

Victor Viale Koroeskohr

View GitHub Profile
//> using lib "org.typelevel::toolkit::0.0.2"
import cats.effect.*
import io.circe.Decoder
import fs2.Stream
import fs2.io.file.*
import org.http4s.ember.client.*
import org.http4s.*
import org.http4s.implicits.*
import org.http4s.circe.*
@Koroeskohr
Koroeskohr / gui.cs
Created February 28, 2017 10:49
Instantiate object in scene Unity (GUI)
var canvas3D = FindCanvas3D();
if (canvas3D == null) throw new System.Exception(TODO);
var gizmo = Instantiate(Resources.Load<GameObject>("GizmoLine"));
gizmo.transform.SetParent(canvas3D.transform);
gizmo.transform.localScale = TODO;
static Canvas FindCanvas3D() {
var canvas = FindObjectsOfType<Canvas>();
foreach (var c in canvas) {
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Mailvelope v1.5.2
Comment: https://www.mailvelope.com
xsFNBFgkOOMBEADdOjK1QOosWwbK6fwBF4UXCGi6TqJYPLTxPOtmfX6pjyAk
Y/wn+AoUp5Mp7x/iSLxnTd/kuVxnGlW/xbVr7gplIrDw8fClBc0BkMFBmyvl
TqdcLDhsbOG3XJCVmrrs90P3y/Rm68AQ8xO9NYlAnD/IuFkSY9Psf9CrU2eA
JAfJCbWM4d9CUg8iH2EBGetm+c7oZC7+xK63/BWJs6Kj6NpsipkRlh6NRwQP
FpsQnr6lOgcjIWjS5PjlMItaJxZaNjS33SUZWA7YnM78FOB5IltmtERCdq4u
b+brTx/9ciKfVYOs2kyesbYk4ZBc9589ASRP+LxIFqUSU51pDzNnjKepOw4N
@Koroeskohr
Koroeskohr / ruby-zsh-install.sh
Created November 5, 2016 17:14
Install Ruby with ZSH
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
rbenv install -v 2.3.1
rbenv global 2.3.1
@Koroeskohr
Koroeskohr / slack_notification.rb
Created August 11, 2016 14:01
slack notification
require 'net/http'
require 'uri'
user = "votre_username"
uri = URI.parse("https://<group>.slack.com/services/hooks/slackbot?token=<token>&channel=%40#{user}")
request = Net::HTTP::Post.new(uri)
request.body = "votre_message"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
@Koroeskohr
Koroeskohr / or_if_blank.rb
Created July 27, 2016 14:23
Object monkey patch for Rails view syntactic sugar
class Object
def or_if_blank(object = nil, &block)
if blank?
return yield if block_given?
object
else
self
end
end
end
@Koroeskohr
Koroeskohr / _attr_table.html.arb
Created July 4, 2016 14:51
Partialify index or show for active admin page
# app/views/admin/resource/_attr_table.html.arb
context.instance_eval do
attributes_table do
row :name
# ...
end
end
@Koroeskohr
Koroeskohr / Gemfile
Last active August 12, 2016 14:19
Beloved Gems
# Spring is a bug nest, Turbolinks is annoying. REMOVED.
=begin
Those gems shouldn't be added to the Gemfile because they mess with a Rails install.
- Mailcatcher : catches all mails sent by the Rails application by setting up the SMTP server as Mailcatcher's in development.
=end
source 'https://rubygems.org'