THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| /* | |
| * Trying to feature-detect (very naive) | |
| * CSS Flexbox support. | |
| * - Only most modern syntax | |
| * | |
| * Is this nonsense? | |
| */ | |
| (function NaiveFlexBoxSupport(d){ | |
| var f = "flex", e = d.createElement('b'); |
| package proxy | |
| import ( | |
| "io" | |
| "log" | |
| "net" | |
| ) | |
| func Proxy(srvConn, cliConn *net.TCPConn) { | |
| // channels to wait on the close event for each connection |
| """ | |
| Based on: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ | |
| Comments resceived: https://gist.github.com/petrklus/b1f427accdf7438606a6 | |
| Original pseudo code: | |
| Set Temperature = Temperature \ 100 | |
| Calculate Red: | |
| If Temperature <= 66 Then |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| ghanity () | |
| { | |
| local code="$1" url="$2"; | |
| echo 'creating vanity GitHub URL... '; | |
| ghurl=$(curl -s -i http://git.io -F "url=$url" -F "code=$code" | grep Location | awk '{print $2}'); | |
| echo $ghurl | pbcopy; | |
| echo "copied to clipboard: ${ghurl}" | |
| } |
| #! /bin/sh | |
| # @author: Claus Witt | |
| # http://clauswitt.com/319.html | |
| # Adding or Removing Items to hosts file | |
| # Use -h flag for help | |
| DEFAULT_IP=127.0.0.1 | |
| IP=${3:-$DEFAULT_IP} |
These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API. These examples are for polkit versions 106 and later, with the JS interpreter. They won't work with Debian's polkit v105.
If you don't know the action name, either run pkaction and look for anything similar:
pkaction | grep cups
...or try to perform the actual action, cancel it, then look in your system logs:
journalctl -t polkitd -n 10 | grep action