Skip to content

Instantly share code, notes, and snippets.

@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?


@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@Chariotwheel
Chariotwheel / ama_yuasa.md
Created January 21, 2018 20:39
AMA Yuasa Overview

 

Question by /u/lamoragirl:

Tatami Galaxy was one of the few works that really influenced my life and I am deeply grateful to you, the rest of the staff and the original writer for making such a beautiful series. Personally, what did you enjoy the most in the making of Tatami Galaxy, and what would you say was the most challenging/difficult part of it?

Even the difficult parts were fun to do, but in the original story the monologues were very long. Creating movement in interior monologue scenes was difficult to do.

https://www.reddit.com/r/anime/comments/7rypm2/i_am_masaaki_yuasa_director_of_lu_over_the_wall/dt0kxgg/

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 17, 2024 04:56 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@rsattar
rsattar / UserNotifications.swift
Created February 27, 2016 00:34
Swift script that shows how to deliver notifications to OS X Notification Center using purely CLI. This can be pasted into a Playground and executed, too.
import Foundation
// Create a method that will be called instead of
// "bundleIdentifier()" that returns a non-empty
// bundle id, even for a CLI script
extension NSBundle {
func fakeBundleIdentifier() -> NSString {
if self == NSBundle.mainBundle() {
return "dont.mind.me.totally.a.normal.bundleid"
} else {
@ctechols
ctechols / compinit.zsh
Last active November 13, 2024 23:55
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@scerelli
scerelli / _buttons.sass
Created June 9, 2015 10:42
A simply way to create components with same structure but based on different color schemes using sass, in this example i create a set of buttons based on a variable map then looping on it i create a set of classes based on the container key. Feel free to improve this gist :) SASS 3.3 or greater is required
// BUTTONS
// check the $btn var in _variable.scss. to add buttons simply add a block of color inside
// $btn map
=btn-scheme ($type, $color)
.btn--#{$type}
background-color: map-get($color, "bg")
color: map-get($color, "text")
&:hover, &:link, &:focus, &:active
color: map-get($color, "text")
text-decoration: none
@steveklabnik
steveklabnik / wc.rs
Created March 23, 2015 21:50
a little wc-like in rust
#![feature(collections)]
use std::io::prelude::*;
use std::fs::File;
use std::io::BufReader;
fn main() {
let args: Vec<String> = std::env::args().collect();
let filename = args[1].clone();
@JunichiIto
JunichiIto / alias_matchers.md
Last active October 21, 2024 00:54
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@ndarville
ndarville / webm.md
Last active September 30, 2023 18:56
4chan’s guide to converting GIF to WebM - https://boards.4chan.org/g/res/41212767

Grab ffmpeg from https://www.ffmpeg.org/download.html

It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.

The most trivial operation would be converting gifs:

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
  • -crf values can go from 4 to 63. Lower values mean better quality.
  • -b:v is the maximum allowed bitrate. Higher means better quality.