Skip to content

Instantly share code, notes, and snippets.

View Neo-Desktop's full-sized avatar
🙃

Neo Neo-Desktop

🙃
  • San Diego, CA
View GitHub Profile
@Neo-Desktop
Neo-Desktop / center_func.sh
Last active December 1, 2022 20:50
Bash function to vertically/horizontally center text
#!/bin/bash
##
# Horizontaly centers a line of text
#
# @method hcenter
# @param string $text - splat of text
#
##
function hcenter {
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@echo off
SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@Neo-Desktop
Neo-Desktop / gist:2365591b5b4118279547
Created May 8, 2015 18:50
C++ set precision and printf example
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <float.h>
using namespace std;
int main()
{
printf("%.*f\n", FLT_DIG, 3.141592653589);