Skip to content

Instantly share code, notes, and snippets.

View giwa's full-sized avatar

Ken Takagiwa giwa

  • Nombre Premier
  • Tokyo
View GitHub Profile
@pcreux
pcreux / dbt_to_dbdiagram.rb
Created May 3, 2021 16:15
Generate an ERD via dbdiagram.io from a dbt project.
#!/usr/bin/env ruby
# Generate a dbdiagram for dbdiagram.io from a dbt project.
#
# Usage:
# 1. Run `dbt docs generate` first.
# 2. Run `dbt_to_dbdiagram.rb`
# 3. Paste the output in https://dbdiagram.io/
require 'yaml'
require 'json'
@ZackStone
ZackStone / slack-invite-all-members-to-a-channel.js
Created April 14, 2017 13:48
Invite all team members to a Slack channel
/*
https://webapps.stackexchange.com/questions/100820/how-do-i-invite-all-team-members-to-a-new-slack-channel#answer-104062
Instructions: Just browse to the appropriate channel and paste
this script (below) into your Chrome/Firefox dev console and hit enter.
Then wait for the script to run until it completes.
It might take time as there is a limit to how many users may be invited at once.
The script will loop until all team members are invited.
*/
var foundAny=false;
function selectAllByLetter(remainingLetters) {
@satoshin2071
satoshin2071 / new_gist_file.md
Created June 13, 2016 07:36
TestFlightへのアップロード手順

TestFlightへのアップロード手順

前提条件

  • iTunes Connectへサインイン可
  • テスト対象アプリとアカウントの紐付けが完了している
  • Distribution用の証明書がキーチェーンのログイン項目に登録されていること
  • Distribution用のプロビジョニングが追加されていること
@joshlk
joshlk / faster_toPandas.py
Last active May 15, 2023 13:48
PySpark faster toPandas using mapPartitions
import pandas as pd
def _map_to_pandas(rdds):
""" Needs to be here due to pickling issues """
return [pd.DataFrame(list(rdds))]
def toPandas(df, n_partitions=None):
"""
Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is
repartitioned if `n_partitions` is passed.
@indiesquidge
indiesquidge / subdomain-localhost-rails-5.md
Created January 19, 2016 07:42
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@jonathan-beebe
jonathan-beebe / AppDelegate.swift
Last active November 1, 2023 19:11
Detect if a Swift iOS app delegate is running unit tests
import UIKit
// Detect if the app is running unit tests.
// Note this only detects unit tests, not UI tests.
func isRunningUnitTests() -> Bool {
let env = NSProcessInfo.processInfo().environment
if let injectBundle = env["XCInjectBundle"] {
return NSString(string: injectBundle).pathExtension == "xctest"
}
return false
@montanaflynn
montanaflynn / goxy.go
Last active May 29, 2018 12:33
Golang HTTP Proxy
package main
import (
"log"
"flag"
"net"
"net/http"
"net/http/httputil"
"time"
"strconv"
@asufana
asufana / 開発ルール.md
Last active August 18, 2021 12:55
開発ルールについて

開発ルールについて

当部門の開発ルールを文書化する

  • 情報システム部門として社内業務システムを内製している
  • 言語はJava

開発ルールの目的

@reedobrien
reedobrien / proxypass.go
Created May 2, 2015 17:55
A basic auth protected proxy server
package main
import (
"encoding/base64"
"flag"
"io"
"log"
"net/http"
"strings"
)
gulp = require 'gulp'
util = require 'gulp-util'
coffee = require 'gulp-coffee'
sass = require 'gulp-sass'
slim = require 'gulp-slim'
plumber = require 'gulp-plumber'
COFFEE_FILES = './src/coffee/**/*.coffee'
gulp.task 'coffee', ->