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
| (echo "from,to"; grep -Po '(?<=]\()((?!http)[^# /\n]+)(?=(#[^ /\n]*)?\))' !(_Sidebar).md 2>/dev/null | sed 's/\.md:/,/g' | sort | uniq) >map.csv |
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
| (defun wiki-to-link () | |
| (interactive) | |
| (when | |
| (re-search-forward | |
| "https:\/\/github.com\/rusefi\/rusefi\/wiki\/\\(\\([^ #\n]*\\)\\(#[^ \n]*\\)?\\)" | |
| nil t) | |
| (let* ((path (match-string 1)) | |
| (page (match-string 2)) | |
| (pagef (string-replace "-" " " page)) | |
| (link (concat "[" pagef "](" path ")"))) |
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
| (defun rusefi-xml-to-c (struct) | |
| "Convert msq xml to c code which sets values in STRUCT." | |
| (interactive "sStruct:") | |
| (let* ((d (libxml-parse-xml-region (region-beginning) (region-end))) | |
| (n (rusefi-get-param 'name d)) | |
| (n | |
| (if n | |
| n | |
| 1)) | |
| (r (rusefi-get-param 'rows d)) |
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 importToken(uri) { | |
| var url = unescape(uri) | |
| var groups = url.match(/totp\/([^:]+):?(.*)\?secret=([a-zA-Z0-9]+)&algorithm=([A-Z0-9]+)&digits=([0-9]+)&period=([0-9]+)/); | |
| document.querySelector("[name='label']").value = groups[1]; | |
| document.querySelector("[name='secret']").value = groups[3]; | |
| document.querySelector("[name='account']").value = groups[2]; | |
| document.querySelector("[name='issuer']").value = groups[1]; | |
| document.querySelector("[name='period']").value = groups[6]; | |
| document.querySelector("[name='digits']").value = groups[5]; | |
| document.querySelector("[name='algorithm']").value = groups[4]; |
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
| package main | |
| import ( | |
| "os" | |
| "fmt" | |
| "time" | |
| ) | |
| func main () { | |
| year := 2022 |
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/env bash | |
| LINE="" | |
| DRIVES=$(ls /sys/block) | |
| for DRIVE in $DRIVES; do | |
| if ls /dev/$DRIVE 2>/dev/null >/dev/null && ls /sys/block/$DRIVE/device/delete 2>/dev/null >/dev/null; then | |
| SIZE=$(blockdev --getsize64 /dev/$DRIVE | awk '{ split( "B KB MB GB TB" , v ); s=1; while( $1>1024 ){ $1/=1024; s++ } print int($1) v[s] }') | |
| LINE="$LINE p $DRIVE $SIZE" | |
| fi | |
| done | |
| BLOCK=$(zenity --list --title "Choose drive to remove" --radiolist --column="Remove" --column="Device" --column="Size" $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
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "time" | |
| ) | |
| func main() { |
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/env bash | |
| I=0 | |
| while read t; do | |
| I=$((I+1)) | |
| ID=$(echo $t | cut -d "|" -f 1 | xargs) | |
| FIRST=$(echo $t | cut -d "|" -f 2 | xargs) | |
| LAST=$(echo $t | cut -d "|" -f 3 | xargs) | |
| ADDRESS=$(echo $t | cut -d "|" -f 4 | xargs) | |
| CITY=$(echo $t | cut -d "|" -f 5 | xargs) | |
| STATE=$(echo $t | cut -d "|" -f 6 | xargs) |
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
| importClass(Packages.com.sun.star.uno.UnoRuntime); | |
| importClass(Packages.com.sun.star.sheet.XSpreadsheetDocument); | |
| importClass(Packages.com.sun.star.container.XIndexAccess); | |
| importClass(Packages.com.sun.star.table.XCellRange); | |
| importClass(Packages.com.sun.star.table.XCell); | |
| importClass(Packages.com.sun.star.text.XText); | |
| function parseAddress(addr) { | |
| var raddr = addr.split(" ").reverse(); | |
| var ret = {zip: raddr[0], state: raddr[1], city: raddr[2], street: ""}; |
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
| # sudo ln -s ~/nginx.conf unicorn.conf | |
| upstream app_server { | |
| server unix:/tmp/unicorn_padrino.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80; | |
| charset utf-8; | |
| server_name db.innshine.com; |
NewerOlder