Skip to content

Instantly share code, notes, and snippets.

View tamouse's full-sized avatar
🏠
Working from home

Tamara Temple tamouse

🏠
Working from home
View GitHub Profile
@tamouse
tamouse / a-readme.md
Last active May 14, 2017 22:38
Minimum needed for header/main/footer full height stretch
(defun comment-or-uncomment-line-or-region ()
"DWIM comment or uncomment line or region"
(interactive)
(let (start end )
(if mark-active
(progn
(setq start (mark))
(setq end (point)))
(progn
(setq start (line-beginning-position))
@tamouse
tamouse / guardreset.sh
Last active April 29, 2017 21:07
As a developer running emacs, When I am through testing, I want my emacs windows to go back to normal. https://swaac.tamouse.org/tools/2017/04/29/resetting-emacs-colours-after-working-with-guard/
#!/bin/bash
# resetore the original colors when done running guard
[ -x "$(which emacsclient)" ] && emacsclient --eval '(set-face-attribute '\''mode-line nil :background "#1e2320" :foreground "#acbc90")' >/dev/null
[ -x "$(which tmux)" ] && tmux set status-left-bg colour239
@tamouse
tamouse / s3_client.py
Last active June 16, 2023 21:14
Example: An S3 proxy client written in Python
"""
The server application uses AWS S3 in various places.
This utility provides a common place for interacting
with S3 and handles the authentication in a unified manner.
"""
import os.path
import logging
#!/usr/bin/env ruby
# Dragon name:
# * Last 2 letters of your first name
# * Middle 2 letters of your last name
# * First 2 letters of your mother's name
# * Last letter of your father's name
# Example:
# First Name: Tamara
#!/usr/bin/env ruby
#
# Make a collection of gallery images:
# - thumbnails: 200x200 square
# - gallery: 450 horizontal
# - web: 1024 horizontal
require 'fileutils'
require 'yaml'
require 'pathname'
@tamouse
tamouse / post.json
Last active August 29, 2015 14:25
jekyll format post as json file exampel
{
"title": "Quote: Control is an Illusion",
"categories": [
"quotes"
],
"tags": [
"control",
"illusion",
"delusion"
],

I've been through the links on orgmode.com about doing this, but there's still something missing about it for me.

Jekyll posts and pages begin with YAML frontmatter. This is placed in the .org file with #+BEGIN_HTML / #+END_HTML guards. That limits me to sub-editing that section (with C-c ') in html-mode. I can't switch to yaml-mode and back to html-mode to edit it as YAML, though, as it somehow loses context and can't switch out of the sub-edit mode.

Is there some way to do what I wish, i.e. edit the frontmatter in YAML

@tamouse
tamouse / aa_http_authentication_example.markdown
Last active August 29, 2015 14:11
Requiring HTTP authorization for a route.

How to use HTTP basic authorization in a controller.

FilterController uses a before_filter callback, calling authenticate_or_request_with_http_basic.

PostsController uses the http_basic_authentication_with callback.

Keybase proof

I hereby claim:

  • I am tamouse on github.
  • I am tamouse (https://keybase.io/tamouse) on keybase.
  • I have a public key whose fingerprint is D3C8 FC31 E395 FEB0 B827 FF3F 9578 4824 BC3D 4D6F

To claim this, I am signing this object: