Skip to content

Instantly share code, notes, and snippets.

View tf0054's full-sized avatar

Takeshi Nakano tf0054

  • Curious Technology GmbH
  • Berlin, Germany
View GitHub Profile
@fnky
fnky / stripe-keys-and-ids.tsv
Last active September 16, 2025 08:48
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
package org.gennai.audio_analyzer.analysis;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import org.gennai.audio_analyzer.analysis.AudioTest.Audio;
@pesterhazy
pesterhazy / es6-class-react.cljs
Last active August 17, 2018 13:14
React component in pure cljs using ES6 class inheritance
;; implementing a React component in pure cljs, no reagent necessary
;; using goog.object.extend to create a ES6 class that inherits from
;; React.Component
;; credit to @thheller
(defn MyReact [props context updater]
(this-as this
(js/React.Component.call this props context updater)))
@lnostdal
lnostdal / atomically_rename.clj
Last active August 27, 2021 10:12
Move a file atomically in Clojure
;;; Move a file atomically in Clojure.
;; This will also replace the target file if it exists since REPLACE_EXISTING is included in the options at the end.
;; user.dir == current working directory (on Linux at least).
(let [source-filename (str (System/getProperty "user.dir") "/source.txt")
target-filename (str (System/getProperty "user.dir") "/target.txt")
source-file (java.nio.file.Paths/get (java.net.URI/create (str "file://" source-filename)))
target-file (java.nio.file.Paths/get (java.net.URI/create (str "file://" target-filename)))]
(java.nio.file.Files/move source-file target-file
@RichardHightower
RichardHightower / using_cojure_from_java.md
Created April 6, 2016 19:54
Example using Clojure from Java

Normal Java project

tree
.
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
@Mike-Honey
Mike-Honey / ExpandAllRecords.M
Created March 22, 2016 21:50
ExpandAllRecords function for Power Query or Power BI - expands all record-type columns recursively
// Based on Chris Webb's blog post - http://blog.crossjoin.co.uk/2014/05/21/expanding-all-columns-in-a-table-in-power-query/
let
//Define function taking two parameters - a table and an optional column number
Source = (TableToExpand as table, optional ColumnNumber as number) =>
let
//If the column number is missing, make it 0
ActualColumnNumber = if (ColumnNumber=null) then 0 else ColumnNumber,
//Find the column name relating to the column number
ColumnName = Table.ColumnNames(TableToExpand){ActualColumnNumber},
@matthewtckr
matthewtckr / MongoShard.bat
Last active May 26, 2025 15:57
MongoDB Sharding Example
REM
REM Setup a MongoDB Sharded Cluster
REM
REM Reference: http://cookbook.mongodb.org/operations/convert-replica-set-to-replicated-shard-cluster/
REM More Info: http://www.kchodorow.com/blog/2010/08/09/sharding-and-replica-sets-illustrated/
REM
REM Download and Unpack MongoDB Software
REM
SET URL="https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.11.zip"
@JacobNinja
JacobNinja / pipeline.clj
Last active April 6, 2022 09:14
Clojure core.async pipeline example
(require '[clojure.core.async :as async]
'[clj-http.client :as client]
'[clojure.data.json :as json])
(def concurrency 5)
(let [in (async/chan)
out (async/chan)
request-handler (fn [url out*]
(async/go
@sgrove
sgrove / uri_parser.cljs
Created June 2, 2015 03:01
General URI Query Param to ClojureScript datastructure function
;; Remember to (:import goog.Uri) in your ns declaration
;; Example input/output:
;; http://localhost:10555/?model=duck&manual-tick=false&collapse-all=true&capture-first-frame=true&skybox-name=sky1.png&age=30&money=300.30
;; => {:model "duck",
;; :tick-first-frame? false,
;; :manual-tick? false,
;; :collapse-all? true,
;; :capture-first-frame? true,
;; :skybox-name ["sky1" "png"],
;; :age 30,
@mrtns
mrtns / gist:78d15e3263b2f6a231fe
Last active January 19, 2025 08:02
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update