Skip to content

Instantly share code, notes, and snippets.

View jugyo's full-sized avatar
🏠
Working from home

Kaz jugyo

🏠
Working from home
  • The League
  • New Jersey
View GitHub Profile
#!/bin/sh
echo $* | awk '{ gsub(/[^A-Za-z]+/, "-"); print tolower($0) }'
# Depends on App
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An example SAM template for Lambda Safe Deployments.
Parameters:
DomainName:
Type: String
CertificateArn:
@jugyo
jugyo / App.yaml
Last active April 13, 2019 04:19
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An example SAM template for Lambda Safe Deployments.
Globals:
Api:
BinaryMediaTypes:
- '*/*'
Resources:
@jugyo
jugyo / deploy.rb
Created March 14, 2012 04:47
choose a branch to deploy
set :branch, lambda {
branch = ENV['REV'] || Capistrano::CLI.ui.ask("[cap] Branch or Tag (default `master`): ")
branch.empty? ? "master" : branch
}
@jugyo
jugyo / gist:865475
Created March 11, 2011 05:02
TextMate command to convert slim to html
#!/usr/bin/env ruby
# Input: Selected Text or Nothing
# Output: Replace Selected Text
require 'tempfile'
def unindent(text)
lines = text.split(/\n/)
level = lines.map{|l| l[/^\s*/].size}.min
const test = require("firebase-functions-test")(
{
databaseURL: "https://my-project.firebaseio.com",
storageBucket: "my-project.appspot.com",
projectId: "my-project",
},
"./testServiceAccountKey.json"
)
const functions = require("../index") // NOTE: This has to be called after `require("firebase-functions-test")(...)`
export { functions }
"use strict";
import * as process from "process";
import * as vscode from "vscode";
import * as fs from "fs-extra";
const dirPath = `${process.env.HOME}/.vscode/jsnippet`;
const extension = "snippet";
const template = "console.log($1);";
@jugyo
jugyo / systemd-tmpfiles-clean.md
Last active September 26, 2018 16:08
Arch linux & systemd-tmpfiles-clean

/tmp on Arch Linux

Arch linux はメモリーの半分の容量のスペースを tmp ファイルシステムとして /tmp にマウントする。例えば8GBのメモリを積んでいたら /tmp の容量はデフォルトで 4GB になる。試しに手元の環境で df コマンドを実行すると以下のような情報が得られた:

# df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             3.9G     0  3.9G   0% /dev
run             3.9G  384K  3.9G   1% /run
/dev/sda 158G 8.0G 142G 6% /
let mainQueue = OperationQueue.main
NotificationCenter.default.addObserver(forName: NSNotification.Name.UIApplicationUserDidTakeScreenshot, object: nil, queue: mainQueue) { _ in
action()
}
@jugyo
jugyo / vs-code-key-bindings.json
Created April 27, 2018 02:55
VS Code key bindings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+t",
"command": "workbench.action.quickOpen"
},
{
"key": "ctrl+cmd+left",
"command": "workbench.action.navigateBack"
},