This file contains 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
(global-set-key (kbd "s-p") 'hydra-profiler/body) | |
(defhydra hydra-profiler (:hint none :exit t) | |
" | |
Hydra Profiler (_q_uit) | |
_s_ start profiler | |
_x_ reset profiler | |
_k_ stop profiler | |
_r_ profiler report | |
" | |
("q" nil) |
This file contains 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
(execute-on-machine work-machine (add-to-list 'load-path | |
"~/l360/src/extern/copilot.el")) | |
(execute-on-machine work-machine (progn | |
(require 'copilot) | |
(define-key copilot-completion-map (kbd "y") 'copilot-accept-completion) | |
(define-key copilot-completion-map (kbd "n") 'copilot-next-completion) | |
(define-key copilot-completion-map (kbd "c") 'copilot-clear-overlay) | |
(global-set-key (kbd "s-u") 'copilot-complete) | |
)) |
This file contains 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
;; allow customizations per machine | |
(setq hostname (car (split-string system-name "\\."))) | |
(defmacro execute-on-machine (machine-name &rest body) | |
"Execute BODY only if the machine name matches MACHINE-NAME." | |
`(let ((current-machine hostname)) | |
(when (string-equal current-machine ,machine-name) | |
,@body))) | |
(setq work-machine "mellotron") |
This file contains 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
var database = "sample"; | |
var collection = "tests"; | |
var connections = []; | |
config = db.getMongo().getDB("config"); | |
config.shards.find().forEach( | |
function (shard,_a,_i) { | |
connections.push(new Mongo(shard["host"])); | |
} |
This file contains 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
{ | |
"id": 1, | |
"title": "MongoDB", | |
"originalTitle": "MongoDB", | |
"tags": [], | |
"style": "dark", | |
"timezone": "browser", | |
"editable": true, | |
"hideControls": false, | |
"sharedCrosshair": false, |
This file contains 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/bash | |
target=hyper-shortcuts.tex | |
cat <<EOF>$target | |
\documentclass{article} | |
\pagestyle{empty} | |
\usepackage{longtable} % Because our table will spawn more than one page | |
\usepackage[dvipsnames]{xcolor} % To use commands like \textcolor{red}{]} | |
\title{Emacs Hyper and F key shortcuts} | |
\begin{document} | |
\maketitle |
This file contains 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 'Tcp port: 3306 Unix socket: /tmp/mysql.sock\nTime Id Command Argument' | |
union | |
select concat(date_format(event_time, '%y%m%d %H:%i:%S'), ' ', thread_id, ' ', command_type, '\t', argument) | |
from general_log | |
into outfile '/tmp/test' | |
fields terminated by '' |
This file contains 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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func mainLoop() { | |
fmt.Println("starting main loop, this will die after dividing by 0") | |
i := 0 |
This file contains 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
{ | |
"__inputs": [ | |
{ | |
"name": "DS_PROMETHEUS", | |
"label": "Prometheus", | |
"description": "with node exporter and jmx exporter", | |
"type": "datasource", | |
"pluginId": "prometheus", | |
"pluginName": "Prometheus" | |
} |
This file contains 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
grep -r VmSwap /proc/[0-9][0-9]*/status 2>/dev/null|sort -k2 -nr | \ | |
while read procentry meminkb; do | |
pid=$(echo $procentry|awk -F'/' '{print $3}') | |
echo "$(cat /proc/$pid/comm) ($pid): $meminkb" | |
done 2>/dev/null |more |
NewerOlder