Skip to content

Instantly share code, notes, and snippets.

View Luxter77's full-sized avatar
πŸ’­
In the process of imploding

Lucas Daniel Velazquez M. Luxter77

πŸ’­
In the process of imploding
View GitHub Profile
@hSATAC
hSATAC / 256color.pl
Created July 20, 2011 14:48
256color.pl
#!/usr/bin/perl
# Author: Todd Larason <[email protected]>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
@southpolesteve
southpolesteve / gist:4152385
Created November 27, 2012 04:31
Open Source License for a Commercial SaaS Application

Background

I am building a SaaS application and I would like to be able to publish the source code while retaining commercial rights to the application. I did some research and it seems that most popular licenses are not structured to fit this model. I realize this kind of license may not fit with the general spirit of open source, but the alternative for most SaaS companies is that their primary code base is closed source. I am not convinced that has be the case. Why couldn't an app like Github or Basecamp be open source? Why couldn't community members submit pull requests and be paid for their work? There may be valid reasons this model won't work, but I am interested in exploring this further and hearing opinions

License Goals

  • Code can be freely distributed
  • Code can be modified without consent
  • Code can be run on a personal machine for personal use
  • Code cannot be used for commercial purposes, for the benefit of a commercial entity, or to directly compete with the copyright owner ("the co
@aras-p
aras-p / preprocessor_fun.h
Last active July 14, 2025 13:08
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@mpetroff
mpetroff / jail.local
Last active March 28, 2025 03:19
JupyterHub PAM Authentication Fail2ban Configuration
# /etc/fail2ban/jail.local
[jupyterhub]
enabled = true
port = 443
filter = jupyterhub
backend = systemd
maxretry = 6
@ab
ab / πŸ’©.rb
Last active November 16, 2020 22:25
#!/usr/bin/env ruby
alias πŸ“„ puts
class AπŸ–₯
@@🐴 = {
πŸ˜‚: 'Hello, world!',
πŸ™ƒ: 'HALP',
πŸ–₯: 'computer.',
}
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active July 17, 2025 23:46
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@kmhofmann
kmhofmann / building_tensorflow.md
Last active December 16, 2024 20:45
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht

@aras-p
aras-p / main.cpp
Last active December 3, 2017 13:06
Slow to compile inline tables under MSVC
// See http://aras-p.info/blog/2017/10/24/Slow-to-Compile-Table-Initializers/
//
// Some combination of "enums-like-ints" utilities (global operators) and
// large constant data tables placed inside functions (instead of global variables)
// is causing VS2015+ to be fairly slow at compiling with /O2
//
// Here's a simplified excerpt taken from a larger codebase (Unity game engine),
// and cut down a bit to have a small-ish repro. The most slow part was the
// GetDesc function, with a large FormatDesc table initialization inside of it,
// coupled with FormatPropertyFlags using ENUM_FLAGS macros to define "type-safe"
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active July 21, 2025 13:21
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).