Skip to content

Instantly share code, notes, and snippets.

why has the new github hidden statuses?

Qais Patankar qaisjp

why has the new github hidden statuses?
View GitHub Profile
View misleading-cat.cpp
/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
#include <cstdio>
nkcmr /
Last active Jul 17, 2019
Informal Golang Proposal: `catch` block as an alternative to `if err != nil`

Informal Golang Proposal: catch block as an alternative to if err != nil

PLEASE NOTE: I am not a language designer or have any experience in implementing or mainting a language or compiler. So, I would love to write out the EBNF syntax for what I am about to propose, but alas, I wouldn't know where to start. So, please forgive the informal nature of the proposal and feel free to ask questions; hopefully I'll be able to keep up with actual experts in this field and if not I apologize for my naivety in advance!

When the try() proposal was closed, I was relieved. There is a problem to be solved here, but try, to me at least, created more problems while trying to solve one.

The main problems, I think it created were the following:

  • try reduced the visiblility of failures. For example:
yougg / detectrun.go
Created Jun 20, 2019
Detect if windows golang executable file is running via double click or from cmd/shell terminator
View detectrun.go
// +build windows
//go:generate go build -ldflags "-s -w -extldflags '-static'" $GOFILE
package main
import (
MPThLee / enableDiscordExperiments.js
Last active Apr 10, 2021
Enable Discord Developer Menus in any environment except mobile app without BetterDiscord using Console.
View enableDiscordExperiments.js
(() => {
// Extracted from Samogot's LibDiscordInternals for BetterDiscord.
const req = typeof(webpackJsonp) === "function" ? webpackJsonp([], {
'__extra_id__': (module, exports, req) => exports.default = req
}, ['__extra_id__']).default : webpackJsonp.push([[], {
'__extra_id__': (module, exports, req) => module.exports = req
}, [['__extra_id__']]]);
delete req.m['__extra_id__'];
delete req.c['__extra_id__'];
const find = (filter, options = {}) => {
kubasz /
Last active Nov 30, 2017
Checksums of program outputs
# To run you need to:
# * Have compiled mem_sim.c to mem_sim in the same folder
# * Have mem_trace.txt in the same folder as this script
# * Save the script as
# * Run: chmod +x
# * Run: ./
declare -A checksums
View .bashrc
# use zsh instead of bash
case $- in
if [ $(which zsh 2>/dev/null) ]; then
export SHELL=$(which zsh)
export BASH=""
exec zsh
dufferzafar / allah-and-gsoc-irc-chat.txt
Last active May 18, 2020
"Allah & GSoC" - an excerpt from #gsoc IRC channel.
View allah-and-gsoc-irc-chat.txt
[6:48 pm] <Guest25582>
[6:48 pm] <valorie> rather than pasting a random link, why not say what it is, Guest25582?
[6:48 pm] <Guest25582> Allah is doing
[6:48 pm] <Guest25582> sun is not doing Allah is doing
[6:48 pm] <Guest25582> moon is not doing Allah is doing
[6:48 pm] <meflin> this channel is about GSOC
[6:48 pm] <Guest25582> stars are not doing Allah is doing
[6:48 pm] <valorie> please stay on topic or leave, Guest25582
[6:48 pm] <Guest25582> planets are not doing Allah is doing
[6:48 pm] <valorie> pfff
View Common Swift String Extensions
import Foundation
extension String
var length: Int {
get {
return countElements(self)
tiimgreen / app.rb
Created Apr 12, 2014
A simple Ruby program.
View app.rb
puts 'Hello World'
datagrok /
Last active Mar 30, 2021
"Vendoring" is a vile anti-pattern

"Vendoring" is a vile anti-pattern

What is "vendoring"?

From a comment on StackOverflow:

Vendoring is the moving of all 3rd party items such as plugins, gems and even rails into the /vendor directory. This is one method for ensuring that all files are deployed to the production server the same as the dev environment.

The activity described above, on its own, is fine. It merely describes the deployment location for various resources in an application.