Skip to content

Instantly share code, notes, and snippets.

View ibakhtin's full-sized avatar

Igor Bakhtin ibakhtin

  • Georgia
View GitHub Profile
@ibakhtin
ibakhtin / powershell.go
Created May 28, 2021 19:06 — forked from coolbrg/powershell.go
Playing PowerShell command via Golang
package main
import (
"bytes"
"fmt"
"os/exec"
"strings"
)
// PowerShell struct
@ibakhtin
ibakhtin / bash-cheat-sheet
Created February 21, 2021 10:02 — forked from ssledz/bash-cheat-sheet
BASH Cheat Sheet
B A S H C H E A T S H E E T
to page output forward (only): command filename | more
to page output forward & back: command filename | less
to print a dataset: lp datasetname (-d printerid) (-o landscape)
USE OF QUOTATION MARKS
echo "$varname" = echo The value of \$varname is \"$varname\"
= echo "The value of \$varname is \"$varname\"."
$fred='Four spaces between these words.'
@ibakhtin
ibakhtin / web-servers.md
Created February 11, 2021 18:09 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
# Flushing all rules
/sbin/iptables -F
/sbin/iptables -X
# allow all loopback connections
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# allow all outgoing connections to wan
iptables -A OUTPUT -o eth0 -j ACCEPT
const asyncMiddleware = fn => (req, res, next) => {
Promise.resolve(fn(req, res, next).catch(next);
};
const getUser = async (req, res, next) => {
const { id } = req.params;
const user = await User.findById(id);
}
router.get("/user/:id", asyncMiddleware(getUser));
@ibakhtin
ibakhtin / sanfrancisco-font.css
Created December 14, 2018 20:39 — forked from jukbot/sanfrancisco-font.css
San Francisco Web Font
/**
* http://applemusic.tumblr.com/
*/
/** Ultra Light */
@font-face {
font-family: "San Francisco";
font-weight: 100;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff2");
}
@ibakhtin
ibakhtin / sanfrancisco-font.css
Created December 14, 2018 20:22
San Francisco Web Font
/** WARNING - USE AT OWN RISK */
/** IT IS AGAINST APPLE'S POLICY TO USE SF PRO FOR ANYTHING OTHER THAN iOS/tvOS/macOS/watchOS DESIGN & DEVELOPMENT */
/** https://sf.abarba.me/font.css */
/** https://sf.abarba.me/LICENSE.pdf */
/** 1. Copy/import this file into your main css/scss file */
/** 2. Change css font-family: to "SF Text", "SF Display" or "SF Mono" */
/** 3. Apply font-weight or italic to html elements */
/** THANK YOU */
@ibakhtin
ibakhtin / build.gradle
Last active August 29, 2018 20:15
Gradle file for some groovy project
plugins {
id 'groovy'
id 'java'
}
group 'eu.bakhtin'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8