Skip to content

Instantly share code, notes, and snippets.

View iwan's full-sized avatar

Iwan Buetti iwan

  • Milano, Italy
View GitHub Profile
@iwan
iwan / route.rb
Last active August 29, 2015 13:59 — forked from vparihar01/route.rb
# NOTE below gems are only for development purpose can be removed and commented out as per requirement
group :development do
gem 'rails-erd','1.0.0'
gem 'hirb','0.7.0'
gem 'railroady'
gem 'itslog','0.6.1'
gem 'quiet_assets'
gem 'sextant' # now included in Rails 4.0
end
@masciugo
masciugo / test.rb
Last active August 29, 2015 14:26
boilerplate code for a ruby script with bundler/inline
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
@vparihar01
vparihar01 / printingJavascriptObject.js
Created June 25, 2013 13:23
for printing down the javascript [object Object] value.This get all properties values of a Javascript Object (without knowing the keys).
for(var key in objects) {
var value = objects[key];
}
Object.values = function (obj) {
var vals = [];
for( var key in obj ) {
if ( obj.hasOwnProperty(key) ) {
vals.push(obj[key]);
}
require 'net/http'
def download_net_http(urls, thread_count)
queue = Queue.new
urls.map { |url| queue << url }
threads = thread_count.times.map do
Thread.new do
Net::HTTP.start('our-s3-bucket.s3.amazonaws.com', 80) do |http|
while !queue.empty? && url = queue.pop
@hmans
hmans / elixir_phoenix_notes.md
Last active April 4, 2018 12:33
Notes on learning Elixir and Phoenix

Notes on learning Elixir and Phoenix

Just some assorted notes I've made while digging into Phoenix, Elixir and friends. I'm coming from a strong Rails background, so many of these will refer to features from that framework.

Views / Templates

Biggest difference from Rails?

Unlike Rails, where rendering is almost always performed by a template file, the responsibility of rendering a response in Phoenix lies with a view module (that typically corresponds to the current controller module.) This view module will typically offer a whole bunch of render functions (matching different parameters, first and foremost the template name.) Templates (found in web/templates/) will directly compile into such functions.

@ndelitski
ndelitski / 1.yml
Created November 30, 2015 15:03
drone.yml examples
clone:
path: github.com/gogits/gogs
build:
image: golang:$$GO_VERSION
environment:
- TAGS="pam sqlite"
- BUILD_OS="windows linux darwin freebsd openbsd netbsd"
@albertgrala
albertgrala / coffescript.coffee
Created December 9, 2012 00:33
Sandbox: CoffeeScript jQuery hover
# $('.drink li').hover(function() {
# $(this).find('span').show();
# }, function() {
# $(this).find('span').hide();
# });
$('.drink li').hover(
->
$(@).find('span').show()
->
$(@).find('span').hide()
@mbenatti
mbenatti / up-and-running-with-edeliver-on-do.md
Created February 20, 2018 05:56 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
@biovisualize
biovisualize / README.md
Last active July 29, 2019 14:42
Test for attaching a png to a gist
  1. Create a new public gist on https://gist.github.com/
  2. Under "Clone this gist", copy the link (i.e., https://gist.github.com/4415518.git)
  3. If you have the command line git tools, clone this gist to a local folder: git clone https://gist.github.com/4415518.git
  4. It will add a folder with the gist id as a name (i.e., 4415518) under the current working directory. Navigate to this folder in the command line: cd 4415518 (dir 4415518 on windows)
  5. Navigate to this folder in your file explorer and add an image (i.e., test.png)
  6. Add it to git from the command line: git add test.png
  7. Commit it to git: git commit -m "I just added a file!"
  8. Push this commit to your remote gist (you will need your Github user name and password): git push
  9. Go back and refresh your Gist on https://gist.github.com/ to confirm that it worked
@davidejmancino
davidejmancino / province.geojson
Created October 31, 2015 09:11
Confini amministrativi delle province italiane
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.