Skip to content

Instantly share code, notes, and snippets.

@tak-bro
tak-bro / toKebabCase.js
Created October 7, 2020 04:25
[JS] convert string to kebab case
// from: 30 Seconds of Knowledge
const toKebabCase = str =>
str &&
str
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
.map(x => x.toLowerCase())
.join('-');
toKebabCase('camelCase'); // 'camel-case'
@tak-bro
tak-bro / tmux-tmuxinator-setup.md
Created October 25, 2018 03:47 — forked from colmarius/tmux-tmuxinator-setup.md
Project start/stop with tmux + tmuxinator

1. Install tmux + tmuxinator

gem install tmuxinator

2. Add ~/.tmuxinator project specific configurations

# File: ~/.tmuxinator/project-name.yml

name: project-name
// https://stackoverflow.com/questions/29290313/in-ios-how-to-drag-down-to-dismiss-a-modal
class ViewControllerPannable: UIViewController {
var panGestureRecognizer: UIPanGestureRecognizer?
var originalPosition: CGPoint?
var currentPositionTouched: CGPoint?
override func viewDidLoad() {
super.viewDidLoad()
@tak-bro
tak-bro / csv-to-json.js
Created April 27, 2018 01:55 — forked from iwek/csv-to-json.js
CSV to JSON Conversion in JavaScript
//var csv is the CSV file with headers
function csvJSON(csv){
var lines=csv.split("\n");
var result = [];
var headers=lines[0].split(",");
for(var i=1;i<lines.length;i++){
@tak-bro
tak-bro / introrx.md
Created March 29, 2018 06:27 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@tak-bro
tak-bro / builder.cpp
Created August 31, 2017 05:31 — forked from pazdera/builder.cpp
Example of `builder' design pattern in C++
/*
* Example of `builder' design pattern.
* Copyright (C) 2011 Radek Pazdera
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@tak-bro
tak-bro / hoon
Created December 28, 2014 02:04
00 9574
01 8827
02 8336
03 7964
04 7143
05 6652
06 6501
07 5922
08 5629
09 5596