Skip to content

Instantly share code, notes, and snippets.

View spdrman's full-sized avatar

Roman spdrman

View GitHub Profile
@spdrman
spdrman / webpack.config.js
Created December 19, 2017 22:16 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@spdrman
spdrman / s3boto.py
Created June 8, 2018 21:38
Use Boto3 to upload and delete an object from an AWS S3 bucket using given credentials
import boto3
session = boto3.Session(
aws_access_key_id="id",
aws_secret_access_key="secret",
region_name="us-east-1"
)
s3 = session.resource("s3")
obj = s3.Object("mybucket", "test.txt")
@spdrman
spdrman / embed swaggerui
Created July 29, 2018 02:26 — forked from telecoda/embed swaggerui
embed swaggerui in a go service
package swaggerui
import (
"net/http"
)
//go:generate go-bindata-assetfs -pkg=swaggerui -prefix=static/swagger-ui static/swagger-ui/dist/...
/*

Multiple reactive plots towards a complete trader dashboard in D3

Copyright © 2015, Anil Nair - MIT License

@spdrman
spdrman / Contract Killer 3.md
Created September 30, 2019 16:44
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@spdrman
spdrman / GIF-Screencast-OSX.md
Created January 14, 2020 04:55 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@spdrman
spdrman / errors.rs
Created January 29, 2022 19:26 — forked from frasertweedale/errors.rs
classy errors in rust
/* Composable errors via traits
A major challenge (among several) in error handling is how to deal with
disjoint error types produced by the libraries you use (as well as by
your own program) in a consistent and ergonomic way. Rust's `?` operator
improves the ergonomics of error handling, but it can only be used with
a single error type throughout a single function. Libraries define their
own error types and they don't know about each other, nor about the calling
program. So if we want to deal with errors from different libraries as
a single type (an sum or enum of the different underlying error types), we
@spdrman
spdrman / playground.rs
Created January 29, 2022 19:29 — forked from rust-play/playground.rs
Code shared from the Rust Playground
/*
Exercise about the Rust error handling.
Follow the instructions in the comments "Exercise" below.
References:
Book: https://doc.rust-lang.org/nightly/book/ch09-00-error-handling.html
Rust Standard Library: https://doc.rust-lang.org/stable/std/index.html
Crates IO: https://crates.io/
random: https://rust-random.github.io/rand/rand/fn.random.html
@spdrman
spdrman / reset.css
Created May 14, 2022 01:56 — forked from simonausten/reset.css
Email CSS Reset
<style type="text/css">
/****** EMAIL CLIENT BUG FIXES - BEST NOT TO CHANGE THESE ********/
.ExternalClass {
width: 100%;
}
/* Forces Outlook.com to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }
/* Forces Outlook.com to display normal line spacing, here is more on that: http://www.emailonacid.com/forum/viewthread/43/ */

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r