Skip to content

Instantly share code, notes, and snippets.

View genbtc's full-sized avatar

genBTC genbtc

  • NJ, USA
View GitHub Profile
@genbtc
genbtc / gist:9a6cd4076c260549ed7b
Last active May 10, 2017 06:43
Program for niel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
using Ionic.Zip;
namespace niel
{
@genbtc
genbtc / discord.js
Created May 10, 2017 06:39
Franz modified discord.js to load BetterDiscord mod script properly (not intended to be run inside a sandboxed WebGuest window in electron
function getMessages() {
for (var e = document['getElementsByClassName']('guilds-wrapper')[0]['getElementsByClassName']('badge'), t = 0, r = 0; r < e['length']; r++) {
var n = parseInt(e[r]['innerText']['replace'](/[^0-9.]/g, ''));
n > 0 && t++
};
ipcRenderer['sendToHost']('message-discord', {
count: t
})
}
//
@genbtc
genbtc / oneliner.bash
Created December 10, 2017 08:57
bash script for prefix append
//Would like to have these first two lines come in as args $1 $2
pre=mingw-w64-x86_64
set -- toolchain freeglut freetype libpng libjpeg-turbo
for p in "$@"; do
a+=("$pre-$p");
done
set -- "${a[@]}"
echo "$@"
@genbtc
genbtc / ffmpeg-vcpkg-instructions
Created December 25, 2017 11:18
How to install ffmpeg through VCPKG
//////////README: further @ https://github.com/Microsoft/vcpkg//////////////
C:
cd \
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
.\vcpkg install ffmpeg:x64-windows
@genbtc
genbtc / gist:1012b8a92cb6583cdc824eb315697d52
Created December 25, 2017 11:21
FFmpeg through VCPKG Log.
C:\vcpkg>bootstrap-vcpkg.bat
vcpkgDownloadFile : Exception calling "DownloadFile" with "2" argument(s): "Unable to
connect to the remote server"
At C:\vcpkg\scripts\fetchDependency.ps1:78 char:5
+ vcpkgDownloadFile $url $downloadPath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [vcpkgDownloadFile], MethodInvocationEx
ception
+ FullyQualifiedErrorId : WebException,vcpkgDownloadFile
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
add_definitions(-DCCACHE_FOUND=OFF)
end()
@genbtc
genbtc / fizzbuzz.cpp
Created September 21, 2018 15:22
FizzBuzz test implementation done in C++
//September 21, 2018 - genBTC (GPL License)
#include <iostream>
using namespace std;
int main() {
for (int i = 1; i < 101; i++) {
if (i % 15 == 0)
cout << "FizzBuzz" << endl;
else if (i % 5 == 0)
cout << "Buzz" << endl;
@genbtc
genbtc / fizzBuzz.py
Created September 21, 2018 15:30
FizzBuzz test implementation done in Python (Fizz Buzz)
def fizzBuzz():
for i in xrange(1,101):
if (i % 15 == 0):
print("FizzBuzz");
elif (i % 5 == 0):
print("Buzz");
elif (i % 3 == 0):
print("Fizz");
else:
print(i);
@genbtc
genbtc / redirectconsole.cpp
Last active August 15, 2021 09:39
Console buffer handle
void RedirectIOToConsole() {
//Create a console for this application
AllocConsole();
// Get STDOUT handle
HANDLE ConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
int SystemOutput = _open_osfhandle(intptr_t(ConsoleOutput), _O_TEXT);
FILE *COutputHandle = _fdopen(SystemOutput, "w");
@genbtc
genbtc / Degrowth is coming - be ready to repair
Last active December 30, 2019 03:10
"Degrowth is coming - be ready to repair" #36C3 (Digitization / Automation)
https://www.youtube.com/watch?v=-hPXK7BCBnY - 36C3 - Degrowth is coming - be ready to repair - english translation
((((((ENGLISH TRANSCRIPTION / NATIVE TRANSLATION version 0.14))))))
.
[Video Description / Abstract (Google translate)]
-------------------------------
The discourse about "digitization" can do one thing above all: promise. Robots free us from tedious work, increases in efficiency take care of the protection of the environment and resources all by ourselves, and algorithms make everyday life easier. The lecture will show that these promises mainly play into the pocket of tech corporations and that we are heading towards ecological and social disasters thanks to the data-gathering (Indian) business models of digital capitalism.
Can the economy continue to grow thanks to more efficient technologies without consuming resources? Or do we not even notice in our lives, which are always full, that we are really running out of raw materials? If we very soon run out of material to build technology that f