Skip to content

Instantly share code, notes, and snippets.

View pastacolsugo's full-sized avatar

Ugo Baroncini pastacolsugo

View GitHub Profile
@pastacolsugo
pastacolsugo / mysql-sail.md
Created April 18, 2023 15:04 — forked from jjcodes78/mysql-sail.md
Laravel Sail - GRANT ALL PRIVILEGES to user

Run this command in sail project folder:

docker-compose exec mysql bash

execute the mysql -u root -p command

provide the default password password

then executes

@pastacolsugo
pastacolsugo / sublime-text-3-plugin-dev-mac.md
Last active December 23, 2019 15:17
Sublime Text 3 plugin development on MacOS
@pastacolsugo
pastacolsugo / lldb-c.md
Created November 26, 2019 12:16
LLDB C/C++ Debugging

C/C++ Debugging with LLDB

Printing Arrays

int v[5] = {10, 20, 50, 30, 40};
(lldb) parray 5 (int*)v
@pastacolsugo
pastacolsugo / lubuntu key remap.md
Last active October 29, 2019 20:34
LUbuntu Key Remap - LXDE
@pastacolsugo
pastacolsugo / setup.sh
Created August 3, 2019 14:32 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@pastacolsugo
pastacolsugo / comment
Created May 2, 2019 22:33
Arduino Leonardo reset-search-upload
From:
https://github.com/gibatronic/sesame
found on StackOverflow @ https://stackoverflow.com/questions/43016993/how-can-i-force-a-leonardo-to-reset-with-avrdude
MAC OSX Hardware Acceleration is made through VideoToolbox
ffmpeg [...] -hwaccel videotoolbox [...]
ffmpeg [...] -c:v h264_videotoolbox [...]
# Obtain codec list
ffmpeg -codecs
# Set framerate (IMPORTANT! Always specify on input stream, otherwise could default to 1000kfps and it's bad)
ffmpeg [...] -framerate 30 [...]
@pastacolsugo
pastacolsugo / stdc++.h
Created November 11, 2018 16:03 — forked from velicast/stdc++.h
Linux GCC 4.8.0 /bits/stdc++.h header definition.
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@pastacolsugo
pastacolsugo / keyrepeat.md
Last active December 5, 2022 16:02 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Sublime Text in Vim mode

Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key that enables you to choose a character from a menu of options. If you are on Lion try it by pressing and holding down 'e' in any app that uses the default NSTextField for input.

It's a nice feature and continues the blending of Mac OS X and iOS features. However, it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, as it means you cannot press and hold h/j/k/l to move through your file. You have to repeatedly press the keys to navigate.

@pastacolsugo
pastacolsugo / latency.txt
Created December 27, 2017 23:40 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD