An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
task :requeue_failed do | |
(Resque::Failure.count-1).downto(0).each do |i| | |
Resque::Failure.requeue(i) | |
Resque::Failure.remove(i) | |
end | |
end |
require 'java' | |
require 'jt400' | |
require 'date' | |
require 'bigdecimal' | |
java_import 'com.ibm.as400.access.AS400JDBCDriver' | |
def get_records | |
@connection ||= java.sql.DriverManager.get_connection("jdbc:as400://127.0.0.1/",'username','password') | |
rs = @connection.createStatement.executeQuery("SELECT * FROM RANDOM_TABLE") |
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
require 'gollum/frontend/app' | |
require 'digest/sha1' | |
class App < Precious::App | |
User = Struct.new(:name, :email, :password_hash, :can_write) | |
before { authenticate! } | |
before /^\/(edit|create|delete|livepreview|revert)/ do authorize_write! ; end | |
helpers do |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from tornado.wsgi import WSGIContainer | |
from tornado.ioloop import IOLoop | |
from tornado.web import FallbackHandler, RequestHandler, Application | |
from wsgi import app | |
class MainHandler(RequestHandler): | |
def get(self): |
The list would not be updated for now. Don't write comments.
The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.
Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:
githubUsers
#!/usr/bin/env sh | |
brew update | |
brew install rbenv | |
brew install ruby-build | |
brew install openssl | |
CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.0.0-preview1 |
source :rubygems | |
gem "puma" | |
gem "sinatra" |