Skip to content

Instantly share code, notes, and snippets.

View clobrano's full-sized avatar
:octocat:

Carlo Lobrano clobrano

:octocat:
View GitHub Profile
@clobrano
clobrano / .bashrc
Created December 9, 2024 08:34
Bashrc excerpt to view git branch in PS1
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
if whoami | grep root > /dev/null; then
SYM="#"
else
SYM="$"
fi
export PS1="\w\$(parse_git_branch)$SYM "
@clobrano
clobrano / modemmanager-uncrustify.cfg
Created April 6, 2022 12:23
[draft] ModemManager Uncrustify configuration file
indent_columns = 4 # The number of columns to indent per level.
indent_with_tabs = 0 # How to use tabs when indenting code 0=spaces only
sp_func_call_paren = force # Add or remove space between function name and '(' on function calls.
nl_end_of_file = remove # Add or remove newline at the end of the file.
nl_fdef_brace = force # Add or remove newline between function signature and '{'.
sp_after_ptr_star = remove # Add or remove space after pointer star '*', if followed by a word.
sp_before_ptr_star = force # Add or remove space before pointer star '*'.
sp_between_ptr_star = remove # Add or remove space between pointer stars '*'.
sp_type_func = force # Add or remove space between return type and function name
{
"meta": { "theme": "kwan" },
"basics": {
"name": "Carlo Lobrano",
"label": "Software Developer",
"picture": "",
"email": "c.lobrano@gmail.com",
"phone": "(912) 555-4321",
"website": "http://carlolobrano.com",
"summary": "Richard hails from Tulsa. He has earned degrees from the University of Oklahoma and Stanford. (Go Sooners and Cardinals!) Before starting Pied Piper, he worked for Hooli as a part time software developer. While his work focuses on applied information theory, mostly optimizing lossless compression schema of both the length-limited and adaptive variants, his non-work interests range widely, everything from quantum computing to chaos theory. He could tell you about it, but THAT would NOT be a “length-limited” conversation!",
@clobrano
clobrano / dominant_color.py
Created November 2, 2018 16:37
add background to icon with its dominant color
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vi: set ft=python :
'''
usage: dominant.py --filename=<path> [--order=<order>] [--npoints=<value>]
options:
-f path, --filename=path Name of the icon
-o value, --order=value Order of the super ellise [default: 4]
-n points, --npoints=npoints Number of points that render the background [default: 50]
@clobrano
clobrano / init.vim
Last active February 7, 2025 08:19
Minimal init.vim/vimrc (mostly for windows)
" Save this file into ~/.config/nvim/init.vim
"
" BASIC SETUP:
syntax enable
filetype plugin on
" FINDING FILES
" Search down into subfolders
set path+=**
set wildmenu
@clobrano
clobrano / ws.html
Created June 27, 2017 14:53
Simple Example of Websocket broadcast (client side)
<html>
<head>
<script>
var ws = new WebSocket('ws://localhost:8080');
ws.onmessage = function (event) {
document.getElementById('result0').value=event.data;
}
</script>
</head>
<body>
@clobrano
clobrano / ws.js
Last active June 27, 2017 14:52
Simple example of WebSocket broadcast (server side)
const WebSocket = require ('ws');
const wss = new WebSocket.Server({host:'localhost', port:'8080'});
wss.broadcast = function (data) {
wss.clients.forEach ( client => {
if (client.readyState === WebSocket.OPEN) {
client.send (data);
}
});
Verifying that "clobrano.id" is my Blockstack ID. https://onename.com/clobrano
# Dockerizing MongoDB: Dockerfile for building MongoDB images
# Based on ubuntu:latest, installs MongoDB following the instructions from:
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
## Usage
## Basic way
## Usage: docker run --name <name for container> -d <user-name>/<repository>
#$ docker run -p 27017:27017 --name mongo_instance_001 -d my/repo
#
## Dockerized MongoDB, lean and mean!
@clobrano
clobrano / todo.vim
Last active August 31, 2015 12:35
Todo.txt VIM syntax highlight
if exists("b:current_syntax")
finish
endif
hi Cyan3 ctermfg=43 guifg=#00d7af "rgb=0,215,175
hi DarkBlue ctermfg=18 guifg=#000087 "rgb=0,0,135
hi DarkGreen ctermfg=22 guifg=#005f00 "rgb=0,95,0
hi DarkMagenta ctermfg=90 guifg=#870087 "rgb=135,0,135
hi DarkOrange ctermfg=208 guifg=#ff8700 "rgb=255,135,0
hi Green3 ctermfg=34 guifg=#00af00 "rgb=0,175,0