Skip to content

Instantly share code, notes, and snippets.

View mmizutani's full-sized avatar

Minoru Mizutani mmizutani

  • Tokyo
  • 17:38 (UTC +09:00)
View GitHub Profile
@toritori0318
toritori0318 / setup_drone_gitlab.sh
Last active March 27, 2016 13:56
Docker+Drone+Gitlabを一発で構築するスクリプト
#!/bin/sh
set -x
GITLAB_URL='http://ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com:81'
# docker
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y docker.io
import numpy as np
import sklearn.datasets
import sklearn.ensemble
import xgboost
N_TRAIN = 60000
NS_ITERATIONS = [2 ** k for k in range(8)]
MODELS = [
('RandomForestClassifier', sklearn.ensemble.RandomForestClassifier, {'n_jobs': -1}),
@sasaki-shigeo
sasaki-shigeo / gist:3727810
Created September 15, 2012 13:18
Conversion from/to Numeric Type in Scala (Scala における数値型の変換)
import math._
1L // Long型の 1
1:Long // Long型の 1
127:Byte // Byte型の 127
32767:Short // Short型の 32767
(1+2).toLong // Long型への変換
(2+3) toLong // Long型への変換
#!/bin/env python
#
# Usage:
# ./dump.py
# - It will stop after period specified seconds or after getting max size.
# - log is sent to s3 bucket.
# - notification
# > EC2 needed profile (s3 put)
# > You need edit INFRA s3 bucket policy.
#
@topheman
topheman / jspm.travis.setup.md
Created August 4, 2015 18:49
Travis setup of Github token for jspm
@yuroyoro
yuroyoro / development.js
Created February 15, 2017 02:16
webpakcer.gemにscssのビルドを加えて、大きめの依存ライブラリを別ファイルに分けて吐くようにしたwebpack.cnofig
// Note: You must restart bin/webpack-watcher for changes to take effect
var path = require('path')
var webpack = require('webpack')
var merge = require('webpack-merge')
var config = require('./shared.js')
var devconfig = {
devtool: 'sourcemap',
@Jwata
Jwata / README.md
Last active November 23, 2019 10:35
Calculate Rails CSRF token stored in session from authenticity token

On your rails project root

git clone https://gist.github.com/Jwata/4e5122fa43d719400914716955872cc2 authenticity_token_to_csrf_token

rails runner ./authenticity_token_to_csrf_token/calculate.rb 'some_authenticity_token'
=> 2PqIaqHja/+PllheC7mStH2X+y/E69LlyS5AIfd9MVs= # this is the csrf token stored in your session
version_info: "0"
resources:
- "@type": type.googleapis.com/envoy.api.v2.Cluster
name: targetCluster
connect_timeout: 0.25s
lb_policy: ROUND_ROBIN
type: EDS
eds_cluster_config:
service_name: localservices
eds_config:
@nnarhinen
nnarhinen / Gruntfile.js
Last active February 11, 2020 09:39
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
@estesp
estesp / user-ns.md
Last active April 2, 2020 17:10
User namespace proposed docs

Experimental user namespace support

Linux kernel user namespace support provides additional security by enabling a process--and therefore a container--to have a unique range of user and group IDs which are outside the traditional user and group range utilized by the host system. Potentially the most important security improvement is that, by default, container processes running as the root user will have expected administrative privilege (with some restrictions) inside the container but will effectively be mapped to an unprivileged uid on the host.