Skip to content

Instantly share code, notes, and snippets.

View felipemfp's full-sized avatar

Felipe Pontes felipemfp

View GitHub Profile
@felipemfp
felipemfp / launch.json
Created July 11, 2019 16:28
Debug Go with vscode
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Remote debug in Docker",
"type": "go",
"request": "launch",
from hashlib import sha256
from datetime import datetime
class Blockchain:
def __init__(self):
self.blocks = []
self.set_genesis_block()
#!/usr/bin/env bash
set -e
# Installing yarn on Ubuntu or Debian
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
yarn --version
@felipemfp
felipemfp / d.cfg
Created September 21, 2016 09:52
Uncrustify config
#
# My favorite format
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
input_tab_size = 4 # original tab size
output_tab_size = 2 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_string = False # align broken strings

Usage

Save one/all of the following two scripts in a folder within your $PATH. Here's an example on using the first script to make a screencast of a specific window.

  1. Run byzanz-record-window 30 -c output.gif
  2. Go to the window (alt-tab) you want to capture. Click on it.
  3. Wait 10 seconds (hard-coded in $DELAY), in which you prepare for recording.
  4. After the beep (defined in the beep function), byzanz will start.
  5. After 30 seconds (that's the meaning of 30 in step 1), byzanz ends. A beep will be broadcast again.
  6. I included the -c flag in byzanz-record-window to illustrate that any arguments to my shell script are appended to byzanz-record itself. The -c flag tells byzanz to also icnlude the cursor in the screencast.