Skip to content

Instantly share code, notes, and snippets.

View optik-aper's full-sized avatar
🦝

Michael Riley optik-aper

🦝
  • United States
  • 12:26 (UTC -05:00)
View GitHub Profile
@optik-aper
optik-aper / main.go
Created January 25, 2023 19:55
Govultr vm spammer
package main
import (
"context"
"encoding/json"
"fmt"
"time"
"github.com/vultr/govultr/v2"
"golang.org/x/oauth2"
@optik-aper
optik-aper / vim-go-cheatsheet.md
Last active October 13, 2022 16:41 — forked from krlvi/vim-go-cheatsheet.md
vim-go Cheatsheet

vim-go

Plugin https://github.com/fatih/vim-go
Tutorial https://github.com/fatih/vim-go-tutorial
Vimrc https://github.com/fatih/dotfiles/blob/master/vimrc

Run

Commands

  • File :GoRun %
  • Package :GoRun
  • Debug :GoDebugStart
@optik-aper
optik-aper / gist:0b472067da70ae723b6f2828b13aace5
Created August 22, 2022 20:38
qutebrowser virtual env output
michael ~/repos/qutebrowser (:951a14a66|✚1)
Φ ./scripts/mkvenv.py 16:35
==================== Creating virtual environment ====================
$ rm -r .venv
$ python3 -m venv .venv
==================== Upgrading initial packages ====================
venv$ pip install -U pip
Requirement already satisfied: pip in ./.venv/lib/python3.10/site-packages (22.0.2)
@optik-aper
optik-aper / stream.nim
Created July 19, 2018 18:09
Error message
import osproc, streams, strutils, os
let l = ""
let ps = startProcess("/sbin/iwlist", "", ["wlp2s0", "scan"])
let s = outputStream(ps)
while s.readLine(l):
echo(l)
@optik-aper
optik-aper / nre_test.nim
Created October 30, 2017 02:30
Difficulties with nre proc
# Code adapted from the captures tests
# nim/tests/stdlib/nre/captures.nim
import nre
echo("abc".match(re"(?<letter>\w)").captures["letter"])
@optik-aper
optik-aper / wiki_db.nim
Created October 17, 2017 19:09
db_postgres getValue() row number 0 is out of range 0..-1
proc getWikiDbId*(title: string): int =
let db = open(db_srv, db_usr, db_pas, db_nam)
let sql = sql("""
SELECT id
FROM page
WHERE title = ?
""")
let id = getValue(db, sql, title)
@optik-aper
optik-aper / compiler-output
Last active February 17, 2017 00:28
Nim compile output skipping os.nim
config/nim.cfg(42, 3) Hint: added path: '/home/michael/.nimble/pkgs/' [Path]
config/nim.cfg(44, 5) Hint: added path: '/opt/nimble/pkgs/' [Path]
Hint: used config file '/usr/lib/nim/config/nim.cfg' [Conf]
Hint: system [Processing]
lib/system.nim(10, 1) Hint: 103 [Processing]
lib/system.nim(25, 3) Hint: 103 [Processing]
lib/system.nim(43, 3) Hint: 129 [Processing]
lib/system.nim(47, 3) Hint: 135 [Processing]
lib/system.nim(52, 1) Hint: 143 [Processing]
lib/system.nim(56, 1) Hint: 145 [Processing]