Skip to content

Instantly share code, notes, and snippets.

View munazo's full-sized avatar

Ayumi Munakata munazo

  • Recruit Lifestyle Co.,Ltd.
  • Shibuya, Tokyo
View GitHub Profile
@munazo
munazo / codility_solutions.txt
Created January 18, 2017 12:31 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
Lesson 1 - Iterations
- BinaryGap - https://codility.com/demo/results/trainingU2FQPQ-7Y4/
Lesson 2 - Arrays
- OddOccurrencesInArray - https://codility.com/demo/results/trainingFN5RVT-XQ4/
- CyclicRotation - https://codility.com/demo/results/trainingSH2W5R-RP5/
Lesson 3 - Time Complexity
- FrogJmp - https://codility.com/demo/results/training6KKWUD-BXJ/
- PermMissingElem - https://codility.com/demo/results/training58W4YJ-VHA/
@munazo
munazo / ie-curl.sh
Last active September 12, 2018 04:15 — forked from oranblackwell/ie-curl.sh
Curl All IE Virtual Boxes from Microsoft's Modern.ie
#IE6 - XP
curl -O -L "http://www.modern.ie/vmdownload?platform=mac&virtPlatform=virtualbox&browserOS=IE6-WinXP&parts=0&filename=VMBuild_20131127/VirtualBox/ls/Mac/IE6.WinXP.For.MacVirtualBox.sfx"
#IE8 – XP
curl -O -L "http://www.modern.ie/vmdownload?platform=mac&virtPlatform=virtualbox&browserOS=IE8-WinXP&parts=2&filename=VMBuild_20131127/VirtualBox/IE8_WinXP/Mac/IE8.WinXP.For.MacVirtualBox.part{1.sfx,2.rar}"
#IE7 – Vista
curl -O -L "http://www.modern.ie/vmdownload?platform=mac&virtPlatform=virtualbox&browserOS=IE7-Vista&parts=4&filename=VMBuild_20131127/VirtualBox/IE7_Vista/Mac/IE7.Vista.For.MacVirtualBox.part{1.sfx,2.rar,3.rar,4.rar}"
#IE8 – Win7

rbenvとruby-buildでRuby環境を最新に保つ

更新日:2014/11/19

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
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

true and false vs. "truthy" and "falsey" (or "falsy") in Ruby, Python, and JavaScript

Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).

This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.

If you want to use or share this material, please see the license file, below.

Update

@munazo
munazo / s3.rb
Created July 17, 2014 12:43 — forked from bouzuya/s3.rb
require 'rubygems'
require 'bundler/setup'
require 'aws-sdk'
# NOTE: require ENV[...]
# export AWS_ACCESS_KEY_ID='...'
# export AWS_SECRET_ACCESS_KEY='...'
# export AWS_REGION='ap-northeast-1'
s3 = AWS::S3.new
@munazo
munazo / Gemfile
Created December 25, 2013 13:00 — forked from bostonaholic/Gemfile
gem 'memcachier'
gem 'dalli'
class Ball
attr_accessor :result
def initialize
@result = {}
end
def bounce
puts "boun"
@result[:something] = "boun"