Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
:shipit: 👍

Jake jheidt

💭
:shipit: 👍
View GitHub Profile
@XVilka
XVilka / TrueColour.md
Last active May 12, 2021
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@xuhdev
xuhdev / ctags_with_dep.sh
Last active May 10, 2021
Generate ctags file for C or C++ files and its depedencies (included header files). This could avoid you to always generate a huge tags file.
View ctags_with_dep.sh
#!/bin/sh
# https://www.topbug.net/blog/2012/03/17/generate-ctags-files-for-c-slash-c-plus-plus-source-files-and-all-of-their-included-header-files/
# ./ctags_with_dep.sh file1.c file2.c ... to generate a tags file for these files.
gcc -M "$@" | sed -e 's/[\\ ]/\n/g' | \
sed -e '/^$/d' -e '/\.o:[ \t]*$/d' | \
ctags -L - --c++-kinds=+p --fields=+iaS --extra=+q
@sinisterchipmunk
sinisterchipmunk / LICENSE
Last active May 7, 2021
tar, gzip, and untar files using ruby in memory without tempfiles
View LICENSE
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@patrick-fischer
patrick-fischer / AWS.cls
Last active Apr 7, 2021
AWS Authentication using Query Parameters (AWS Signature Version 4): https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
View AWS.cls
/**
// Example implementation as follows:
public class AWSS3_GetService extends AWS {
public override void init() {
resource = '/[your bucket]/[your folder 1]/[your folder 2]/[file name].[extension]';
region = 'eu-west-2';
service = 's3';
endpoint = new Url('https://' + service + '.' + region + '.amazonaws.com/');
accessKey = 'SET HERE';
method = HttpMethod.XGET;
@nickyp
nickyp / self_signed_cert.rb
Last active Apr 7, 2021
create a self-signed certificate using ruby-openssl
We couldn’t find that file to show.
@GuillaumeDua
GuillaumeDua / 13_valuable_things_I_learned_using_CMake.md
Last active Apr 5, 2021
13 valuable things I learned using CMake
View 13_valuable_things_I_learned_using_CMake.md

13 valuable things I learned using CMake

Author : Dua Guillaume
Date : 04-26-2020

Requirement : A first experience with CMake

Intro

As a modern C++ specialist, my job is to focus on software development, from a performance and quality perspective.

View winpath,sh
#!/bin/bash
echo "$@" | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|'
@mustafaturan
mustafaturan / ruby.2.6.3-setup.sh
Last active Nov 19, 2020
ruby 2.6.3 setup for centos 6.x
View ruby.2.6.3-setup.sh
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@jstorimer
jstorimer / hilong.rb
Last active Jul 30, 2020
hilong -- A simply utility to show character counts for each line of input and highlight lines longer than 80 characters.
View hilong.rb
#!/usr/bin/env ruby
# A simply utility to show character counts for each line of input and
# highlight lines longer than 80 characters.
#
# Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html
#
# Examples:
#
# $ hilong Gemfile
@radupotop
radupotop / gist:4013294
Created Nov 4, 2012
PolKit rules to allow mounting, rebooting and network management without a password
View gist:4013294
// /etc/polkit-1/rules.d/10-rules.rules
// PolKit rules to allow mounting, rebooting and network management without a password.
// User needs to be in storage, power and network groups.
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.udisks2.") && subject.isInGroup("storage")) {
return polkit.Result.YES;
}
});