Skip to content

Instantly share code, notes, and snippets.

View Werninator's full-sized avatar
👀

Patrick Werner Werninator

👀
  • Germany
View GitHub Profile
@Werninator
Werninator / because_nobody_told_me_how.md
Created February 18, 2022 22:10
how to set up 4coder like casey muratori from handmadehero.org
@Werninator
Werninator / OpenHelpCommand.py
Last active February 15, 2022 22:56
Sublime Text Plugin to search a selected word in MSDN C++
import sublime
import sublime_plugin
import webbrowser
class OpenHelpCommand(sublime_plugin.TextCommand):
def run(self,edit):
msdnLink = 'https://docs.microsoft.com/en-us/search/?terms={0}';
for region in self.view.sel():
if not region.empty():
syntax = self.view.substr(region)
You ask yourself why an orc would look like an onion.
"Why did you do that?"
"Peeling off my skin makes me cry."
"Oh. I'm sorry."
"Are you going to kill me?"
"I don't know."
The orc's eyes well up. "Peeling off my skin makes me cry."
"I can't kill you. I'm not an orc. But I can make you better."
You take out a flintlock pistol and shoot the orc in the head.
> You victory dance.
// Copyright Patrick Werner 2019
#include "Grabber.h"
#include "Engine/World.h"
#include "GameFramework/PlayerController.h"
#include "Components/PrimitiveComponent.h"
#define OUT
// Sets default values for this component's properties
@Werninator
Werninator / foo.vue
Created October 28, 2019 11:55
reset view component state
<template lang="pug">
p {{ bar }}
</template>
<script>
export default {
name: 'Foo',
data() {
return {
bar: 'baz',
@Werninator
Werninator / php_detect_eol.php
Last active October 3, 2020 17:34
[php] detect EOL type from string
<?php
/**
* Detects the end-of-line character of a string.
* modified version from https://stackoverflow.com/questions/11066857/detect-eol-type-using-php
* @param string $str The string to check.
* @param string $default Default EOL (if not detected).
* @return string The detected EOL, or default one.
*/
function detectEol($str, $default = PHP_EOL) {
@Werninator
Werninator / composer install oneliner.sh
Created January 30, 2019 15:02
composer install oneliner
curl -sS https://getcomposer.org/installer | php
Datenschutzerklärung
--
no data whatsoever will be collected
@Werninator
Werninator / csv-to-assoc.php
Created September 12, 2018 09:34
csv with semicolons to assoc array
<?php
// modified version of https://steindom.com/articles/shortest-php-code-convert-csv-associative-array
function str_getcsv_semicolons($input) {
return str_getcsv($input, ';');
}
$rows = array_map('str_getcsv_semicolons', file($filedir));
$header = array_shift($rows);
@Werninator
Werninator / login-popup.js
Created July 31, 2018 10:17
sweetalert2 login box
// it's in german but you can translate it if you want to
import swal from "sweetalert2";
import axios from "axios";
const loginPopup = () => {
swal({
title: "Login",
backdrop: false,
showCancelButton: true,