Skip to content

Instantly share code, notes, and snippets.

@jbosse
jbosse / snippet_board.html
Created December 17, 2021 15:50
Snippet Board
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Code Snippit Board</title>
<style>
table {
width: 100%
}
defmodule Rain do
def trap(heights) do
answer = 0
index_l = 0
index_r = Enum.count(heights) - 1
max_l = 0
max_r = 0
count(heights, answer, index_l, index_r, max_l, max_r)
end
@jbosse
jbosse / example.js
Last active January 14, 2021 13:28
Simple test helper for Vue tests
import { shallowMount } from "@vue/test-utils";
import App from "./App.vue";
import { expectSelect } from "../../../testHelpers.js";
describe("Sample", () => {
it("will help verifying layouts", () => {
const wrapper = shallowMount(App);
expectSelect(wrapper, "table", {}, (table) => {
expectSelect(table, "tr", {count: 5});
@jbosse
jbosse / mysql-docker.sh
Created December 15, 2016 20:20 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@jbosse
jbosse / make_a_patch.md
Last active February 26, 2016 19:24
Make a patch
@jbosse
jbosse / SetupDevBoxForSsh.md
Created February 23, 2016 18:28
Steps for setting up vim and gnu screen for rails development the way I like it.

Development Term Setup

Install Pathogen to Vim

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Modify ~/.vimrc

execute pathogen#infect()
ngrok ready.
/Users/jbosse/Downloads/Exponent XDE.app/Contents/Resources/app/template/node_modules/babel-core/lib/transformation/file/options/option-manager.js:193
throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname));
^
ReferenceError: Unknown plugin "transform-decorators-legacy" specified in "/Users/jbosse/Downloads/Exponent XDE.app/Contents/Resources/app/.babelrc" at 0, attempted to resolve relative to "/Users/jbosse/Downloads/Exponent XDE.app/Contents/Resources/app"
at /Users/jbosse/Downloads/Exponent XDE.app/Contents/Resources/app/template/node_modules/babel-core/lib/transformation/file/options/option-manager.js:193:17
at Array.map (native)
at Function.normalisePlugins (/Users/jbosse/Downloads/Exponent XDE.app/Contents/Resources/app/template/node_modules/babel-core/lib/transformation/file/options/option-manager.js:173:20)
at OptionManager.mergeOptions (/Users/jbosse/Downloads/Exponent XDE.app/Contents/Resources/app/template/node_modules/babe
extension String {
func split(seperator: Character) -> [String]{
return self.characters.split{$0 == seperator}.map{String($0).stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())}
}
}
@jbosse
jbosse / xcode-build-bump.sh
Created October 24, 2015 17:59 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
Delivered-To: jimmy@thebosses.net
Received: by 10.64.21.170 with SMTP id w10csp162906iee;
Mon, 4 Nov 2013 11:22:59 -0800 (PST)
X-Received: by 10.224.131.67 with SMTP id w3mr24722838qas.62.1383592978812;
Mon, 04 Nov 2013 11:22:58 -0800 (PST)
Return-Path: <sn6456@aol.com>
Received: from eastrmfepo201.cox.net (eastrmfepo201.cox.net. [68.230.241.216])
by mx.google.com with ESMTP id p5si4246755qcp.52.2013.11.04.11.22.58
for <jimmy@thebosses.net>;
Mon, 04 Nov 2013 11:22:58 -0800 (PST)