MongoDBの便利なサーバー関数等をまとめたものです.
This file contains hidden or 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
| console.clear(); | |
| // Define User model | |
| const defaultValues = { | |
| // Should be `undefined` value at all | |
| id: undefined, | |
| name: undefined, | |
| dob: undefined, | |
| friends: undefined, | |
| }; |
This file contains hidden or 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
| #!/bin/bash -e | |
| TEMP_FILE=/tmp/authorized_keys | |
| KEYS_FILE=~/.ssh/authorized_keys | |
| GITHUB_USER=$1 | |
| test -n $GITHUB_USER | |
| echo "Sync SSH authorized keys from Github user ${GITHUB_USER}" | |
| mkdir --mode=700 -p ~/.ssh | |
| curl -f -o $TEMP_FILE https://github.com/${GITHUB_USER}.keys |
This file contains hidden or 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 'bundler' | |
| Bundler.setup | |
| require 'benchmark/ips' | |
| class ArrayDemo | |
| def initialize(data) | |
| @data = data | |
| end |
This file contains hidden or 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
| class App < Sinatra::Base | |
| configure do | |
| set :logger_level, :warn | |
| set :logger_log_file, File.join(root, 'log', "#{environment}.log") | |
| end | |
| configure :development do | |
| set :logger_level, :debug | |
| end |
This file contains hidden or 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
| import React, { Component, PropTypes } from 'react'; | |
| const ENTER = 13; | |
| export default class TextField extends Component { | |
| static get displayName() { | |
| return 'TextField'; | |
| } | |
| static get propTypes() { |
This file contains hidden or 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
| git clone --bare git@ghe1:foo/bar.git | |
| cd web.git/ | |
| git remote add ghe2 git@ghe2:foo/bar.git |
This file contains hidden or 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
| brew install grc | |
| curl -o ~/.grcat https://raw.github.com/nitso/colour-mysql-console/master/.grcat | |
| curl -o ~/.my.cnf https://raw.githubusercontent.com/nitso/colour-mysql-console/master/.my.cnf | |
| mysql |
This file contains hidden or 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
| struct backend { | |
| unsigned magic; | |
| #define BACKEND_MAGIC 0x64c4c7c6 | |
| VTAILQ_ENTRY(backend) list; | |
| int refcount; | |
| struct lock mtx; | |
This file contains hidden or 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
| vim/.netrwhist | |
| vim/bundle/* | |
| !vim/bundle/vundle | |
NewerOlder