This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (~window.navigator.userAgent.indexOf('Trident')) { | |
| location.href = 'https://getfirefox.com'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " 自動で YAML に変換して書きだす (*.x.yaml とすること) {{{ | |
| function! s:yaml_to_json() | |
| let l:from = expand('%') | |
| let l:to = expand('%:r:r') . '.json' | |
| let l:result = system('ruby -rjson -ryaml -e "puts(JSON.pretty_generate(YAML.load(ARGF.read)))" ' . shellescape(l:from) . ' > ' . shellescape(l:to)) | |
| if v:shell_error | |
| echoerr printf("Failed to yaml_to_json: %d\n%s", v:shell_error, l:result) | |
| endif | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function upload () { | |
| local src="$1" | |
| # ... | |
| mv "$temp" "$src" | |
| clean_src () { | |
| rm "$src" | |
| } | |
| trap clean_src EXIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| let handle; | |
| let start = function () { | |
| function get () | |
| liberator.modules.util.readFromClipboard().replace(/\n/g, ' ').trim(); | |
| if (handle) | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; For https://bitbucket.org/anekos/iron-maiden-cl | |
| ; Hyprland {{{ | |
| (defvar *hyprland-mutex* (sb-thread:make-mutex :name "hyprland-mutex")) | |
| (defvar *hyprland-active-window-class* nil) | |
| (defun extract-hyprland-active-window (line) | |
| (let ((prefix "activewindow>>")) | |
| (when (and (stringp line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| evernote_doAction( document.popupNode, 'CLIP_ACTION_FULL_PAGE' ); | |
| evernote_doAction( document.popupNode, 'CLIP_ACTION_IMAGE' ); | |
| evernote_doAction( document.popupNode, 'CLIP_ACTION_SELECTION' ); | |
| evernote_doAction( document.popupNode, 'CLIP_ACTION_URL' ); | |
| evernote_doAction( document.popupNode, 'NEW_NOTE_ACTION' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Usage: add-random [[NUMBER [FILTER]] | |
| sels="${1:-10}" | |
| filter="${2:-}" | |
| mpc listall | grep "$filter" | shuf | head "-n" "$sels" | while read selected | |
| do | |
| echo "$selected" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| #[=c= ruby -rubygems % ] | |
| class HTMLBuilder | |
| def initialize (tag_name = 'html', indent = 0, &block) | |
| @indent = indent | |
| @tag_name = tag_name | |
| @attrs = {} | |
| @contents = [] | |
| self.instance_eval(&block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| host, | |
| MAX(usage_user), | |
| time_bucket('10min', time) AS bucket | |
| FROM | |
| telegraf.cpu | |
| WHERE | |
| ( | |
| to_timestamp($__unixEpochFrom()) - | |
| (NOW() - NOW() AT TIME ZONE 'UTC') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for n in $(seq 1 8) | |
| do | |
| curl "https://www.google.com/logos/fnbx/animal_paws/audio/cat_sound_${n}.mp3" > "/tmp/xmosh/cat_sound_${n}.mp3" | |
| done | |
| for n in $(seq 1 9) | |
| do | |
| curl "https://www.google.com/logos/fnbx/animal_paws/cat_paw_${n}.png" > "/tmp/xmosh/cat_paw_${n}.png" | |
| done |
NewerOlder