This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Bitbucket totals in PR | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Show total changed lines of code | |
// @author You | |
// @match https://bitbucket.org/*/*/pull-requests/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// random bootstrapper for any theoretical ts/js application | |
const timeout = (millis: number, fn: () => void) => new Promise(c => setTimeout(c, millis)).then(fn); | |
(async function boot() { | |
// this try-catch is an additional safety net used for (poorly) written applications in which errors | |
// are not properly caught | |
try { | |
// some random loading of initial components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print_git_data() { | |
if [ $(parse_git_branch) ]; then | |
printf ' (' | |
printf $(parse_git_branch) | |
printf ' ' | |
printf $(parse_latest_commit_hash) | |
printf ')' | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gp='function __gp() { (python3 ~/Documents/python/$1.py $(shift;printf "$*") 2>/dev/null) || echo "File not found or errors occurred."; unset -f __gp; }; __gp' | |
# (assumption hiworld.py is an actual file) | |
# | |
# usage: gp hiworld | |
# usage: gp sub/dir/hiworld arg0 arg1 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*****************************************************************************\ | |
** mandelbrot sample program for cc65. ** | |
** ** | |
** (w) 2002 by groepaz/hitmen, TGI support by Stefan Haubenthal ** | |
\*****************************************************************************/ | |
#include <stdlib.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include <conio.h> | |
#include <joystick.h> | |
#include <nes.h> | |
static const char text[] = "get on that nesdev"; | |
int main(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <cc65.h> | |
#include <conio.h> | |
#include <tgi.h> | |
#include <nes.h> | |
#include <joystick.h> | |
#define TGI_COLOR_BLACK 0x00 | |
#define TGI_COLOR_GREEN 0x01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================== Generic (limited) curry function: | |
func curry<A, B, C>(_ f: @escaping (A, B) -> C) -> (A) -> (B) -> C { | |
return { a in { b in f(a, b) }} | |
} | |
// ========================== Example 1: | |
let add = curry((+) as ((Int, Int) -> Int)) | |
let add2 = add(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
using System.Text.RegularExpressions; | |
namespace FakeTypes | |
{ | |
// All types within this namespace are considered fakes. A UInt128 is a struct | |
// containing two ulongs, their primary reason for existence is for quick calculation | |
// and comparisons of hash strings as numbers. Allocation should be on the stack. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void PrintByteArray(byte[] bytes) | |
{ | |
var sb = new StringBuilder("new byte[] { "); | |
foreach (var b in bytes) | |
{ | |
sb.Append(b + ", "); | |
} | |
sb.Append("}"); | |
Console.WriteLine(sb.ToString()); | |
} |
NewerOlder