Skip to content

Instantly share code, notes, and snippets.

@picandocodigo
picandocodigo / speakerdeck-oembed.rb
Created February 14, 2013 17:59
Get speakerdeck oEmbed url
def slide(slide)
if slide.match('speakerdeck')
require 'net/http'
url = URI.parse("https://speakerdeck.com/oembed.json?url=#{slide}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
response = http.request(Net::HTTP::Get.new(url.request_uri))
response.body
end
end
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
mQINBFJW01cBEADOAEhd2ErND2XaN7Hx7ptjYk2HJThLp4OfTBxOTqFjMraFEQXS
FsN09ocMsIVb2euKyOUQsBrq4UuUF5Vaax0F3vM7ok10/+G//g7jG+eY27xrX9x5
jrs7lhTyp3/zVjuCM0W+dFh5adY1qc/h6/FSlcCMKJ6EkC4iuS9qfOQgMOqx+pml
noaLaGPXfmhuYrW0Xt6GONSHyd36nvyVauDXbMugJ2d9U6nVOSgJPJmwu2G26Lql
mpwX8UCBZg+8D0eHwxlMMNudJaQ7P5wv8GS3e+376uJ6fSU1kWtUspUz7u/SErX5
nilzjeoAjSNgF6fUUrj7uVzvZn5GCO5app3UchSlF4HwdRxH9V6xHCm7X1a3KHip
JfLLdqoTPJvUlb+xSHoZVdryZhhdqA9mofsId1ZQdGL0z0H0nz560O3hfwGQarst
@picandocodigo
picandocodigo / emacs.el
Created March 13, 2014 04:59
My first Emasc config file
;LoadPath -
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir "~/.emacs.d/")
(default-directory my-lisp-dir))
(setq load-path (cons my-lisp-dir load-path))
(normal-top-level-add-subdirs-to-load-path)))
;Color-theme
(require 'color-theme)
(setq color-theme-is-global t)
#!/bin/sh
while true; do
inotifywait -e modify ../templates &&
handlebars ../templates/ -f ../js/templates.js
echo "Templates updated"
done
require 'requests'
require 'tco'
while true do
begin
response = Requests.request("GET", "http://picandocodigo.net")
puts "WORKING".bg("#00FF00") if response.status == 200
`vlc http://www.youtube.com/watch?v=wOh968qao74 &`
break
rescue => e
@picandocodigo
picandocodigo / select.js
Created February 19, 2016 22:39
Limit a <select> checked count
// interests is a <select multiple> element
var interests = document.getElementById('interests');
interests.addEventListener('change', function(event){
var selected = this.querySelectorAll("option:checked");
if (selected.length > 3){
selected[0].selected = false;
}
});
@picandocodigo
picandocodigo / ruby-advent-calendar-enterprise-search.md
Last active December 2, 2020 12:49
Ruby Advent Calendar - elastic-enterprise-search

elastic-enterprise-search

This gem is the official Elastic Enterprise Search client and it's currently out as a beta release. Enterprise Search is an Elastic solution for search in the enterprise. It's powered by the Elastic Stack and Elasticsearch, so you get all the great things you already know in one package for your team. It's the umbrella solution which contains Workplace Search, App Search and Site Search. The client focuses on App Search and Workplace Search.

What is Elastic Workplace Search?

Workplace Search is a unified search solution for teams. One of the interesting things about Workplace Search to me is at previous jobs I wished I had a product like this. We had different documents and manuals on so many different services: wikis, Jira, email, Dropbox, Basecamp. Whenever you needed to find a specific document you had to find out where to look for it, and then search. Workplace gives you a single search experien