Skip to content

Instantly share code, notes, and snippets.

@tomcam
tomcam / alltasks.html
Last active October 16, 2015 20:05
web2py todo app fails on GAE cloud server - October 16, 2015
{{extend 'layout.html'}}
{{if 'message' in globals():}}
<h3>{{=message}}</h3>
{{pass}}
<h1>
All tasks
</h1>
<h2>
{{=A(T('Active tasks'), _href=URL('index'))}}
{{=A(T('Assignments'), _href=URL('assignments'))}}
@tomcam
tomcam / update1.html
Last active June 30, 2017 06:36
update1.html spectre.css template
<!doctype html>
<html lang="en">
<head>
<title>Update1 template--Spectre.css</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/spectre.css/0.2.10/spectre.min.css" />
</head>
<body>
<div class="container">
  • Spectre.css notes
@tomcam
tomcam / spectre-css-center-test-1.html
Last active January 3, 2024 05:56
How should I center vertically with spectre.css?
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Center test 1 | Spectre.css</title>
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
<style>
<!-- NOT NECESSARY! JUST USE .flex-centered. See comment by @Prid13 at https://gist.github.com/tomcam/4dd6dfb90abdc504daccd9a8003329a3?permalink_comment_id=4815360#gistcomment-4815360 -->
.vcenter {
@tomcam
tomcam / nvim.txt
Last active September 5, 2018 06:23
Neovim/nvim notes
.vimrc equivalent is $HOME/.config/nvim/init.vim
MacOS location of init.vim
$HOME/.config/nvim/
So:
# Create the directory
mkdir -p $HOME/.config/nvim/
# Edit or create the file
nvim $HOME/.config/nvim/init.vim
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Auth Accepted</title>
</head>
<body>
<h1>User signed in and Granted Authorization</h1>
</body>
</html>
@tomcam
tomcam / oauth2.go
Created May 11, 2019 22:51
oauth2 problem
package main
// Goal is to obtain user consent token:
// https://developer.ebay.com/api-docs/static/oauth-consent-request.html
import (
"fmt"
"golang.org/x/oauth2"
"log"
"net/http"
"os"
@tomcam
tomcam / flagbool.go
Created December 28, 2019 19:54
Golang flag bool examples
package main
/* Golang command-line flag tutorial example for boolean flag
Go Playground example at:
https://play.golang.org/p/fEaMQCjxQUT
Assuming the program is named ./t here's example usage and output:
$ ./t
Verbose mode set? false
$ ./t -v
Verbose mode set? true
@tomcam
tomcam / suggestcfgdir.go
Created December 28, 2019 21:04
Tries to suggest what directory user configuration files should be stored in by sniffing the operating system at runtime
package main
import (
"fmt"
"os"
"os/user"
"path/filepath"
"runtime"
)
@tomcam
tomcam / drsh.sh
Last active February 17, 2020 03:21
zsh list hidden and normal directories
#!/bin/zsh
print -rl -- *(D/)