- assembler
- bash
- BASIC
- C
- C++
- Dylan (aka Ralph)
- HyperTalk
- Java
- JavaScript
- Lisp
module ActiveSupport | |
module NewTryable #:nodoc: | |
def try(*a, &b) | |
return unless a.empty? || respond_to?(a.first) | |
return public_send(*a, &b) unless a.empty? | |
return nil unless block_given? | |
return instance_eval(&b) if b.arity == 0 | |
yield self | |
end |
extern crate image; | |
extern crate num_complex; | |
use std::fs::File; | |
use image::{ImageBuffer, Luma}; | |
use num_complex::Complex; | |
fn main() { | |
// for a 3 x 2 image: (-2,-1) to (1,1) |
[alias] | |
recent = "!git fetch --prune && git for-each-ref --sort='-committerdate' refs/remotes/origin/ --format='%(committerdate:iso) %(objectname:short) %(refname:short)'" |
git for-each-ref --sort=-committerdate refs/remotes/origin/ --format='%(committerdate:short) %(refname:short)' |
the alchemist turned lead to gold | |
as tales through the ages have told | |
but alpha decay | |
meant the gleam didn't stay | |
so those isotopes never got old |
Dear Congresswoman Pelosi,
I am writing about an issue in the interaction of technology, crime, and personal safety. I am a resident of San Francisco and live in the 12th District, so I approach you as my representative.
Here in the Castro, as in many urban areas, we are suffering with a crime wave of smartphone muggings. The standard mugging now involves one mugger grabbing the phone and running off, while one or more accomplices lay in wait to ambush and assault the victim if they give chase. A good friend of mine was mugged this way last week, and the reports of similar muggings keep coming in.
While there are things individuals and the community can do to protect ourselves, I think phone manufacturers and carriers can act far more effectively. The problem is that there is no financial incentive for them to take action. On the contrary, they benefit financially every time a phone is stolen and a replacement must be purchased, or someone who acquires a stolen phone pays for cellular service.
**I would l
def collect(&block) | |
inject([]) { |memo, obj| memo << block.call(obj) } | |
end | |
def detect(&block) | |
inject(nil) { |memo, obj| memo ||= obj if block.call(obj) } | |
end | |
def reject(&block) | |
inject([]) { |memo, obj| block.call(obj) ? memo : memo << obj } |
if Rails.env.development? | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/assets/} | |
call_without_quiet_assets(env) | |
ensure |