Skip to content

Instantly share code, notes, and snippets.

View Johann150's full-sized avatar
🔏
all my commits should be signed

Johann150

🔏
all my commits should be signed
View GitHub Profile
@Johann150
Johann150 / Uploader.java
Created November 11, 2017 10:11
Automatic syncing of local and server files via ftp
package main;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
@Johann150
Johann150 / remove-bom.php
Last active January 27, 2018 21:20 — forked from Xhamps/remove-bom.php
Remove Bom
<?php
// root directory in which to start searching
$HOME=$_SERVER["DOCUMENT_ROOT"];
// use alternatively:
// $HOME=dirname(__FILE__);
// $HOME=dirname(__FILE__);
header("Content-Type: text/plain");
echo "BOM removed from files:\n";
RecursiveFolder($HOME);
@Johann150
Johann150 / cipher.cpp
Last active December 28, 2018 17:37
small program that implements some en-/decryption algorithms
/*
vigen - Vigenère Cipher
mat12 - from https://youtu.be/6ZYnA6tguec
*/
#include<iostream>
#include<string>
#include<cmath>
#include<random>
#include<sstream>
@Johann150
Johann150 / audio.js
Created May 27, 2018 13:07
Small demo of how Modems transmit data
var AudioContext = window.AudioContext || window.webkitAudioContext;
var ctx = new AudioContext();
requestAnimationFrame(s);
var number = "0696675356";
var text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
var analy = ctx.createAnalyser();
analy.connect(ctx.destination);
<html>
<head>
<style>
#out{
display:flex;
flex-flow: row no-wrap;
justify-content:center;
margin-bottom: 40px;
}
#out>samp{
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div style="float:left;">
<textarea id="in" cols="80" rows="30"></textarea><br>
<button onclick="go()">go!</button>
<a href="https://esolangs.org/wiki/Emmental" target="_blank">?</a>
@Johann150
Johann150 / bf.c
Last active August 17, 2019 00:10
stream brainfuck interpreter (Also supports Alphuck,Ecstatic
/*
A stream brainfuck interpreter, the input will be read only once.
Also supports Alphuc (https://esolangs.org/wiki/Alphuck),
FuckbeEs (https://esolangs.org/wiki/FuckbeEs),
ReverseFuck (https://esolangs.org/wiki/ReverseFuck),
and the whole TrivialBrainfuckSubstitution (https://esolangs.org/wiki/TrivialBrainfuckSubstitution) language family.
*/
@Johann150
Johann150 / bsod.html
Created June 25, 2019 09:27
Windows 10 BSoD, altered a little
<html>
<body>
<style>
body{
background-color:#0079d8;
font-family:"Segoe UI";
color:white;
cursor:none;
}
#a{
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
int main(int argc,char** argv){
std::streambuf *cinbuf=std::cin.rdbuf(); // save cin buffer in case it is redirected
#include<iostream>
#include<fstream>
#include<string>
#include<stack>
#include<map>
void usage(const char* name){
std::cerr<<name<<" <input> [<file>]\n\nIf the <file> argument is not supplied, the program will be read from stdin."<<std::endl;
}