Skip to content

Instantly share code, notes, and snippets.

View sashabaranov's full-sized avatar

Alex Baranov sashabaranov

View GitHub Profile
@ih2502mk
ih2502mk / list.md
Last active June 8, 2024 21:48
Quantopian Lectures Saved
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active June 2, 2024 11:24
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@lynaghk
lynaghk / gist:f6a25748ca748ddb122146eb7e2e3a3c
Created September 25, 2018 16:53
Sketch systems grammar EBNF
<statechart> = (state / <whitespace> / <comments>)+
state = comments? state-name <whitespace>? <newline> block?
transition = comments? event-name <whitespace>? <'->'> <whitespace>? state-name <newline>
<block> = indent (state / transition / <whitespace> / <comments>)+ dedent
comments = comment (<newline> comment)* <newline>
<comment> = <'#'> #".*"
@miguelmota
miguelmota / command_exists.go
Last active February 15, 2024 09:29
Golang check if command exists
package main
import (
"log"
"os/exec"
)
func main() {
path, err := exec.LookPath("ls")
if err != nil {
# Load the contents of the receipt file
receipt_file = open('./receipt_data.bin', 'rb').read()
# Use asn1crypto's cms definitions to parse the PKCS#7 format
from asn1crypto.cms import ContentInfo
pkcs_container = ContentInfo.load(receipt_file)
# Extract the certificates, signature, and receipt_data
certificates = pkcs_container['content']['certificates']
signer_info = pkcs_container['content']['signer_infos'][0]
@saulshanabrook
saulshanabrook / README.md
Created October 19, 2016 14:20
Saving Web Crypto Keys using indexedDB

This is a working example on how to store CryptoKeys locally in your browser. We are able to save the objects, without serializing them. This means we can keep them not exportable (which might be more secure?? not sure what attack vectors this prevents).

To try out this example, first make sure you are in a browser that has support for async...await and indexedDB (latest chrome canary with chrome://flags "Enable Experimental Javascript" works). Load some page and copy and paste this code into the console. Then call encryptDataSaveKey(). This will create a private/public key pair and encrypted some random data with the private key. Then save both of them. Now reload the page, copy in the code, and run loadKeyDecryptData(). It will load the keys and encrypted data and decrypt it. You should see the same data logged both times.

@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@eliquious
eliquious / README.md
Created January 4, 2016 05:01
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@calstad
calstad / TDA_resources.md
Last active May 30, 2024 04:46
List of resources for TDA

Quick List of Resources for Topological Data Analysis with Emphasis on Machine Learning

This is just a quick list of resourses on TDA that I put together for @rickasaurus after he was asking for links to papers, books, etc on Twitter and is by no means an exhaustive list.

Survey Papers

Both Carlsson's and Ghrist's survey papers offer a very good introduction to the subject

Other Papers and Web Resources

@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active April 5, 2022 10:30
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where: