Skip to content

Instantly share code, notes, and snippets.

@fardjad
fardjad / how-to-install-homebrew-on-debian-based-distros.md
Last active April 23, 2024 23:02
[How to Install Homebrew on Debian-based Distros] Steps required to install homebrew on MX Linux (and other Debian-based distros) #linux #debian #mxlinux #homebrew

How to Install Homebrew on Debian-based Distros

Steps required to install Homebrew on MX Linux (and other Debian-based distros)

Steps

  1. Update apt cache and optionally do a full upgrade

     apt update
    

apt full-upgrade # optional, reboot if needed

@mauricioaniche
mauricioaniche / adivinhacao.c
Created January 8, 2015 16:41
Código do jogo de adivinhação (fim do capítulo de tipos e operações)
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUMERO_DE_TENTATIVAS 3
int main() {
printf("************************************\n");
printf("* Bem vindo ao Jogo de Adivinhação *\n");
printf("************************************\n");
@mminer
mminer / MyService.swift
Last active April 23, 2024 23:00
Components of XPC service.
import Foundation
class MyService: NSObject, MyServiceProtocol {
func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) {
let response = string.uppercased()
reply(response)
}
}
@adammyhre
adammyhre / ImprovedTimers.cs
Last active April 23, 2024 22:56
Improved Timers for Unity
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.LowLevel;
using UnityEngine.PlayerLoop;
namespace ImprovedTimers {
public static class TimerManager {
static readonly List<Timer> timers = new();
E017 DO YOU EXPECT ME TO FIGURE THIS OUT?
E079 PROGRAMMER IS INSUFFICIENTLY POLITE
E099 PROGRAMMER IS OVERLY POLITE
E111 COMMUNIST PLOT DETECTED, COMPILER IS SUICIDING
E123 PROGRAM HAS DISAPPEARED INTO THE BLACK LAGOON
E127 SAYING ’ABRACADABRA’ WITHOUT A MAGIC WAND WON’T DO YOU ANY GOOD
E129 PROGRAM HAS GOTTEN LOST
E139 I WASN’T PLANNING TO GO THERE ANYWAY
E182 YOU MUST LIKE THIS LABEL A LOT!
E197 SO! 65535 LABELS AREN’T ENOUGH FOR YOU?
@nerodono
nerodono / JsonParser.hs
Last active April 23, 2024 22:53
JSON parser written in haskell: no adequate error checking, just JSON
module JsonParser where
import qualified Data.Map as M
import qualified Data.Bifunctor as Bi
import Data.Char ( ord
, chr
, isHexDigit
, isDigit
)
@davispuh
davispuh / steam_console_params.txt
Last active April 23, 2024 22:51
Steam client parameters, consoles commands and variables
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accesscode -
-all_languages - show longest loc string from any language
-batterytestmode - rapidly cycle battery percentages for testing
-bigpicture - Start in Steam Big Picture mode
-blefw -
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
@WebDevSimplified
WebDevSimplified / bootstrap-breakpoint.css
Last active April 23, 2024 22:48
This stylesheet adds text describing the current Bootstrap Breakpoint in the top right corner of the screen.
body {
margin-top: 40px; /* This margin just makes the text easier to read. You can remove it if you want since it can mess with your other styles. */
}
body::before {
content: "XS";
color: red;
font-size: 2rem;
font-weight: bold;
position: fixed;
@fnky
fnky / ANSI.md
Last active April 23, 2024 22:45
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@disintegrator
disintegrator / https-during-dev.macos.sh
Last active April 23, 2024 22:41
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {