Skip to content

Instantly share code, notes, and snippets.

View sush's full-sized avatar

Aylic Petit sush

View GitHub Profile
@practicingruby
practicingruby / idea.md
Last active December 10, 2015 22:49
Evidence based software development

I am considering starting up a community-funded project that is aimed at exploring software development methodologies and practices through the lens of evidence-based scientific studies. The purpose of this project would be to design, conduct, and report on real world experiments that attempt to answer questions that are relevant to everyday programmers.

This project would be subscriber-supported, but would follow a completely open publication model.

Subscribers would pay a small fee (maybe $5 to $10/month) and get all of the following benefits:

  • A monthly progress report summarizing all interesting activity on the project
  • Opportunities to read early drafts of articles
  • Opportunities to participate in pilot sessions for studies
  • Access to a members-only mailing list to discuss research activities with other supporters and with the project's maintainers.
@wrightling
wrightling / design_for_devs.md
Last active December 14, 2015 15:59
CSS, HTML, and Design for a back-end developer. Suggestions from the Ruby Rogues' Parlay list.
@rubiii
rubiii / how_it_works.md
Created December 2, 2012 11:14
MacVim-Formatter for RSpec
$ rspec --format MacVimFormatter --color spec
@xpepper
xpepper / download_rubytapas.rb
Last active January 1, 2019 01:37
This script will download all the published rubytapas. Each episode, with all the attachments, will be downloaded in a folder named after the episode number. For example, in the folder "64" will be downloaded: 064-yield-or-enumerate.html, 064-yield-or-enumerate.mp4, 064-yield-or-enumerate.rb You need to set your credentials (username and passwor…
# username = "my_username"
# pwd = "my_password"
# target_path = "my_target_path"
# saving auth cookie
system %Q{wget --save-cookies /tmp/cookie.txt --keep-session-cookies --post-data "username=#{username}&password=#{pwd}" -O - \
https://rubytapas.dpdcart.com/subscriber/login?__dpd_cart=d08391e6-5fe2-4400-8b27-2dc17b413027}
(25..600).each do |i|
@petehamilton
petehamilton / README.md
Last active July 8, 2021 09:50
Circle CI Build Status widget for Dashing (Single Builds)

Description

Dashing widget to show the build status of a CircleCI project.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then:

@norman
norman / character_reference.rb
Last active September 9, 2021 20:48
HTML entities? We don't need no stinkin' HTML entities.
# coding: utf-8
#
# Encode any codepoint outside the ASCII printable range to an HTML character
# reference (https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_reference_overview).
def encode(string)
string.each_codepoint.inject("") do |buffer, cp|
cp = "&#x#{cp.to_s(16)};" unless cp >= 0x20 && cp <= 0x7E
buffer << cp
end
end
@jwo
jwo / registrations_controller.rb
Created September 30, 2011 23:11
API JSON authentication with Devise
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
@josevalim
josevalim / 0_README.md
Created September 13, 2012 21:52
Sinatra like routes in Rails controllers

Sinatra like routes in Rails controllers

A proof of concept of having Sinatra like routes inside your controllers.

How to use

Since the router is gone, feel free to remove config/routes.rb. Then add the file below to lib/action_controller/inline_routes.rb inside your app.

def output name=((default=true); "caius")
puts "name: #{name.inspect}"
puts "default: #{default.inspect}"
end
output
# >> name: "caius"
# >> default: true
output "avdi"
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy