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
function tracePropAccess(obj, setMethod, path) { | |
path = path || []; | |
return new Proxy(obj, { | |
get: function(target, propKey, receiver) { | |
var temp = Reflect.get(target, propKey, receiver); | |
if (temp && typeof temp === 'object') { | |
return tracePropAccess(temp, setMethod, path.concat(propKey)); | |
} else { | |
return temp; | |
} |
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
#!/bin/bash | |
PROGNAME=$(basename $0) | |
usage() { | |
echo "Usage: $PROGNAME <stream-name> <sequence-number> [<shard-id>] [--region <region>] [--profile <profile>]" | |
exit 1 | |
} | |
REGION= | |
PROFILE= |
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
robot.enter (msg) -> | |
if msg.message.user.room is 'general' | |
msg.send 'TODO' | |
# enterReplies = ['Hi', 'Target Acquired', 'Firing', 'Hello friend.', 'Gotcha', 'I see you'] | |
# leaveReplies = ['Are you still there?', 'Target lost', 'Searching'] | |
# | |
# module.exports = (robot) -> | |
# robot.enter (res) -> | |
# res.send res.random enterReplies |
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 scrollstep = 300 | |
set smoothscroll | |
let scrollduration = 200 | |
map <C-n> :nexttab<CR> | |
map y yankDocumentUrl | |
map d closeTab | |
map u lastClosedTab | |
map <C-f> scrollFullPageDown | |
map <C-b> scrollFullPageUp |
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
Template.hello.onRendered(function() { | |
$.getScript("https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js", function() { | |
$(function() { | |
$('.mhhh').matchHeight(); | |
}); | |
}); | |
}); |
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
db.rooms.insert({_id: 1234567890, members: [{name: "hoge", age: 20}, {name: "fuga", age: 21}]}) | |
db.rooms.update({_id: 1234567890}, {$set: {"members.0.name": "piyo", "members.0.age": 18, "members.1.name": "rodorigesu", "members.1.age": 46}}) |
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
'use strict'; | |
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var path = require('path'); | |
gulp.task('sass', function () { | |
gulp.src('./sass/**/*.scss') | |
.pipe(sourcemaps.init()) |
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
Promise = require 'bluebird' | |
im = Promise.promisifyAll require 'imagemagick' | |
input = './img/bb.png' | |
resize = './img/resize.png' | |
crop = './img/crop.png' | |
exec = -> | |
ext = yield im.identifyAsync ['-format', '%m', input] | |
console.log ext.toLowerCase() |
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
// 値引率の計算 | |
// 値引き額(定価 - 値引き後の金額(存在しない場合は定価)) / 定価 * 100 | |
fl=product(div(sub(price, if(exists(price_discount), price_discount, price)), price), 100) | |
// カテゴリAだったらseqの降順、それ以外はseqの昇順でソート | |
sort=if(exists(query({!v='category:A'})), product(seq, -1), product(seq, 1)) asc |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:jpa="http://www.springframework.org/schema/data/jpa" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd | |
http://www.springframework.org/schema/context | |
http://www.springframework.org/schema/context/spring-context-3.2.xsd | |
http://www.springframework.org/schema/data/jpa |
NewerOlder