- GitHub Staff
- https://bento.me/kyanny
- @kyanny
- in/kyanny
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mongo_mapper' | |
MongoMapper.database = 'testing' | |
class User | |
include MongoMapper::Document | |
end | |
class Bookmark | |
include MongoMapper::Document | |
belongs_to :user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let square = x => x * x; | |
let add = (a, b) => a + b; | |
let pi = () => 3.1415; | |
console.log(square(5)); | |
console.log(add(3, 4)); | |
console.log(pi()); | |
console.log(this.name); | |
this.name = 'they'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'bson', '1.12.2' | |
require 'bson' | |
p BSON::ObjectId.legal?("a"*24+"\n") | |
p BSON::ObjectId.legal?("a"*24+"\na") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"io/ioutil" | |
"os" | |
"fmt" | |
"encoding/json" | |
"log" | |
"runtime" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env emacs --script | |
(setq usage "\ | |
Usage: | |
$ csvcol file.csv 1 2 3 | |
$ csvcol file.csv 4, 5, 6 | |
$ csvcol file.csv 7,8,9 | |
") | |
(require 'package) | |
(setq package-enable-at-startup nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export API_USER=your_sendgrid_username | |
export API_KEY=your_sendgrid_password | |
export EMAIL=foo@example.com | |
export RED='\033[0;31m' | |
export GREEN='\033[0;32m' | |
export NC='\033[0m' # No Color | |
curl -X GET "https://api.sendgrid.com/api/bounces.get.json?api_user=${API_USER}&api_key=${API_KEY}&email=${EMAIL}" > bounces.json | |
count=$(ruby -rjson -e "print JSON.parse(File.read(%Q,bounces.json,)).length") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var generateUrl = require('generate-google-calendar-url'); | |
var url = generateUrl({ | |
start: new Date(2015, 7, 20, 18), | |
end: new Date(2015, 7, 20, 21), | |
title: 'YAPC::Asia Tokyo 2015 前夜祭', | |
location: '東京ビッグサイト会議棟 (Tokyo Bigsight) 6F、7F', | |
details: 'http://yapcasia.org/2015/' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = 'openstack' | |
config.ssh.username = 'stack' | |
config.vm.provider :openstack do |os| | |
os.openstack_auth_url = 'https://identity.tyo1.conoha.io/v2.0/tokens' | |
os.username = ENV['CONOHA_API_USER_NAME'] | |
os.password = ENV['CONOHA_API_PASSWORD'] | |
os.tenant_name = ENV['CONOHA_TENANT_NAME'] | |
os.flavor = '7eea7469-0d85-4f82-8050-6ae742394681' # g-1gb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):015:0> "zh zdqw brx".split(//).map{|c| c.match(/\s/) ? c : (c.ord-3).chr }.join | |
=> "we want _ou" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
# $Id$ | |
use strict; | |
use warnings; | |
use File::Spec; | |
use FindBin; | |
use lib File::Spec->catdir($FindBin::Bin, "..", "lib"); | |
use Getopt::Long; |