theme | marp |
---|---|
uncover |
true |
Find the only
$$ x^3 = (z - y)^3 + 3yz(z - y)
#!bin/bash | |
# Usage: | |
# bash jekyll_new.sh file_title | |
# Example: | |
# bash jekyll_new.sh daily-angst | |
# This script is for creating a new jeykll post under _posts/ | |
# Change as needed |
set number | |
syntax on | |
set mouse=a | |
set softtabstop=4 | |
set tabstop=4 " The width of a TAB is set to 4. | |
" Still it is a \t. It is just that | |
" Vim will interpret it to be having | |
" a width of 4. | |
set shiftwidth=4 " Indents will have a width of 4 | |
set softtabstop=4 " Sets the number of columns for a TAB |
<!DOCTYPE html><html lang="C"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0"><meta name="apple-mobile-web-app-capable" content="yes"><meta http-equiv="X-UA-Compatible" content="ie=edge"><meta property="og:type" content="website"><meta name="twitter:card" content="summary"><style>@media screen{body,html{background:#000;height:100%;margin:0;overflow:hidden}[data-bespoke-marp-fragment=inactive]{visibility:hidden}.bespoke-marp-osc{display:none;opacity:0}.bespoke-marp-parent{bottom:0;left:0;position:absolute;right:0;top:0}.bespoke-marp-parent>.bespoke-marp-osc{background:rgba(0,0,0,.65);border-radius:7px;bottom:50px;color:#fff;display:block;font-family:Helvetica,Arial,sans-serif;font-size:16px;left:50%;line-height:0;opacity:1;padding:12px;position:absolute;touch-action:manipulation;-webkit-transform:translateX(-50%);transform:translateX(-50%);transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user- |
#!/bin/bash | |
# This script is my standard create a new experiment for my new idea/side project/whatever that I normally seem to do. I can change this if I like as I move along. | |
set -e # Fail if one step fails | |
set -x # Print before execute | |
cd ~/Experiments/ | |
mkdir $1 | |
cd $1 |
#!/bin/bash | |
# This script is my standard create a new experiment for my new idea/side project/whatever that I normally seem to do. I can change this if I like as I move along. | |
set -ex | |
mkdir ~/Experiments/$1 | |
cd ~/Experiments/$1 | |
echo "# README" > README.md |
theme | marp |
---|---|
uncover |
true |
Find the only
$$ x^3 = (z - y)^3 + 3yz(z - y)
# This script goes into my Pictures/ folder and uploads it to ffsend. | |
# Requires: jq | |
set -e | |
cd ~/Pictures # configure to other source of pictures if you want | |
API_KEY="[YOUR KEY IT'S FREE TO GET]" | |
FILE_NAME=$(ls -rt | tail -n 1) | |
IMAGE=$( base64 "$FILE_NAME" ) |
title |
---|
Testing 101 |
So far you've been writing your programs amd running them time and time again doing that. A constant cycle of change-run-repeat until it works.
Which works fine until
class FibArray | |
attr_accessor :array, :cache | |
def initialize(array = []) | |
@array = array | |
@cache = [1, 2] # put precomputed results as needed | |
generate_next_fib(array.size - cache.size) | |
end | |
def get(i) |
require 'sinatra' | |
# Ex. http://localhost:4567/calc/add?x=1&y=2 | |
get '/calc/:operation' do | |
operations = { 'add' => ->(x, y) {x + y}, | |
'sub' => ->(x, y) {x - y}, | |
'mul' => ->(x, y) {x * y}, | |
'div' => ->(x, y) {x / y}, | |
'mod' => ->(x, y) {x % y} } | |
# Yes I could DRY that further but I don't trust user input |