Skip to content

Instantly share code, notes, and snippets.

View bob2314's full-sized avatar
:octocat:
Code...

Bob bob2314

:octocat:
Code...
View GitHub Profile
@bob2314
bob2314 / webstorm64.vmoptions
Created March 29, 2019 16:39 — forked from macd2/webstorm64.vmoptions
Jetbrains Custom VM Options Optimized Configuration: Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
# custom WebStorm VM options, this configuration also works well for other IDEs like phpstorm, pycharm..etc.
-Xms1024m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
@bob2314
bob2314 / Slackbot.double
Created October 23, 2018 17:38 — forked from senyaitiya/Slackbot.double
GasでSlackbot、データを2つとって結合して出力
function doPost(y) {
var token = PropertiesService.getScriptProperties().getProperty("xoxp-123");
var name = "name";
var token = PropertiesService.getScriptProperties().getProperty('SLACK_ACCESS_TOKEN');
var app = SlackApp.create(token);
var spreadsheet = SpreadsheetApp.openById('sheetID');
var sheet = spreadsheet.getSheetByName('シート1');
var range = sheet.getRange("シート1!C1").setFormula('=INDIRECT("シート1!A:A" & INT(RAND()*n+1))');
@bob2314
bob2314 / client.py
Created May 18, 2018 22:15 — forked from sharat87/client.py
Code for my article on serializing session objects of python-requests library. http://sharats.me/serializing-python-requests-session-objects-for-fun-and-profit.html
#!/usr/bin/env python
# encoding: utf-8
from __future__ import unicode_literals
import requests as req
URL_ROOT = 'http://localhost:5050'
def get_logged_in_session(name):
@bob2314
bob2314 / local-registry.yml
Created March 29, 2018 22:53 — forked from mtpereira/local-registry.yml
Local development with Kubernetes
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
@bob2314
bob2314 / gist:36554409d6706736a4b4dc07b7514388
Created July 5, 2017 03:57 — forked from nicferrier/gist:2277987
Clone a git repo if it does not exist, or pull into it if it does exist
#!/bin/sh
REPOSRC=$1
LOCALREPO=$2
# We do it this way so that we can abstract if from just git later on
LOCALREPO_VC_DIR=$LOCALREPO/.git
if [ ! -d $LOCALREPO_VC_DIR ]
then
#!/bin/bash
# Predefined links and files. Note: LTS may not be latest LTS
export NODE_STABLE=http://nodejs.org/dist/node-latest.tar.gz
export NODE_LTS=https://nodejs.org/dist/latest-v4.x/node-v4.2.2.tar.gz
export RC_BASH=~/.bashrc
export RC_PROFILE=~/.profile
# Settings
export NODE_VER=$NODE_LTS
@bob2314
bob2314 / deploy.rb
Created April 8, 2017 05:11 — forked from evantahler/deploy.rb
deploy.rb for node apps
set :application, "MY_APPLICATION"
set :repository, "git@github.com:PATH_TO_MY_REPO"
set :scm, :git
set :use_sudo, false
set :keep_releases, 5
set :deploy_via, :remote_cache
set :main_js, "MAIN_APP.js"
desc "Setup the Demo Env"
task :demo do
BOX_NAME=vagrant-build
BASE_DIR="`pwd`/machines"
BOX_DIR="${BASE_DIR}/${BOX_NAME}"
mkdir -p ${BASE_DIR}
VBoxManage createvm --name "${BOX_NAME}" --ostype RedHat_64 --basefolder ${BASE_DIR}
VBoxManage registervm "${BOX_DIR}/${BOX_NAME}.vbox"
mkdir -p tmp
@bob2314
bob2314 / node-and-npm-in-30-seconds.sh
Created December 8, 2016 19:38 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh