Skip to content

Instantly share code, notes, and snippets.

@tily
tily / dot.mongorc.js
Created October 7, 2011 13:40
MongoDB DBQuery extension for easier printjson
DBQuery.prototype.p = function() {
var args = arguments
this.forEach(function(e) {
var result = {}
if(args.length == 0) {
result = e
} else {
for(var i = 0; i < args.length; i++) {
var target = e
var keys = args[i].split('.')
@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@hayajo
hayajo / changelog_en.md
Last active July 19, 2024 05:47
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@chrislkeller
chrislkeller / import_json_appsscript.js
Last active July 16, 2024 13:26
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@phemmer
phemmer / main_test.go
Created April 22, 2015 16:20
go bcrypt benchmark
package main
import (
"testing"
"golang.org/x/crypto/bcrypt"
)
func BenchmarkBcrypt4(b *testing.B) {
benchBcrypt(b, 4)
@akirattii
akirattii / JapaneseUtil.js
Last active June 28, 2017 06:17
日本語をバラバラに分解する。
JapaneseUtil = function() {
const charMode = {
none: null,
ascii: "ascii",
alphaNumMark: "alphaNumMark",
surroundMark: "surroundMark", // "'{} etc.
alphaNum: "alphaNum",
alpha: "alpha",