Here's the simplest example showing how to do functional options in Golang.
They're a great way to enable users to set options and ease adding new options later.
package main
import (
"flag"
"fmt"| echo First word, Adjective: | |
| curl -s "http://api.wordnik.com:80/v4/words.json/randomWord?hasDictionaryDef=false&includePartOfSpeech=adjective&minCorpusCount=0&maxCorpusCount=-1&minDictionaryCount=1&maxDictionaryCount=-1&minLength=5&maxLength=-1&api_key=YOUR_API_KEY_HERE" | |
| echo | |
| echo | |
| echo Second word, Noun: | |
| curl "http://api.wordnik.com:80/v4/words.json/randomWord?hasDictionaryDef=false&includePartOfSpeech=noun&minCorpusCount=0&maxCorpusCount=-1&minDictionaryCount=1&maxDictionaryCount=-1&minLength=5&maxLength=-1&api_key=YOUR_API_KEY_HERE" | |
| echo | |
| echo | |
| echo Now, combine these two, and you have your name. | |
| echo For example, if your two words were ‘taught’ and ‘webzines’, your name would be TaughtWebzines. |
| rm -rf ~/Library/Application\ Support/Slack/ | |
| rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/ | |
| rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist | |
| rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState | |
| rm ~/Library/Safari/LocalStorage/*slack* |
| #!/usr/bin/env python2.7 | |
| from pex.pex_builder import PEXBuilder | |
| from pex.resolvable import resolvables_from_iterable | |
| from pex.resolver import CachingResolver | |
| from pex.resolver_options import ResolverOptionsBuilder | |
| import argparse | |
| import os | |
| import shutil | |
| import sys |
| #!/usr/bin/python | |
| import boto.iam, boto.exception | |
| import argparse, os | |
| import ConfigParser | |
| parser = argparse.ArgumentParser(description="Rotate Access Keys.") | |
| parser.add_argument( | |
| "-p", | |
| "--profile", |
| #!/bin/bash | |
| module=$1 | |
| for resource in `terraform show -module-depth=1 | grep module.${module} | tr -d ':' | sed -e 's/module.${module}.//'`; do | |
| terraform taint -module ${module} ${resource} | |
| done |
Here's the simplest example showing how to do functional options in Golang.
They're a great way to enable users to set options and ease adding new options later.
package main
import (
"flag"
"fmt"[ Update 2025-03-24: Commenting is disabled permanently. Previous comments are archived at web.archive.org. ]
Most of the terminal emulators auto-detect when a URL appears onscreen and allow to conveniently open them (e.g. via Ctrl+click or Cmd+click, or the right click menu).
It was, however, not possible until now for arbitrary text to point to URLs, just as on webpages.
| # This file has been auto-generated by i3-config-wizard(1). | |
| # It will not be overwritten, so edit it as you like. | |
| # | |
| # Should you change your keyboard layout some time, delete | |
| # this file and re-run i3-config-wizard(1). | |
| # | |
| # i3 config file (v4) | |
| # | |
| # Please see http://i3wm.org/docs/userguide.html for a complete reference! |
| """ | |
| Install Systemd units using Ansible | |
| Handles unit restarting and systemd daemon reloading when the unit changes. | |
| Also stops the unit correctly when uninstalled | |
| In your playbook put this file to library/systemdunit.py and make sure the | |
| server has python-sh package installed |