Skip to content

Instantly share code, notes, and snippets.

View Inkering's full-sized avatar
📰
✍️

Dieter Brehm Inkering

📰
✍️
View GitHub Profile
@Inkering
Inkering / base64EncodeDecode.cs
Last active January 16, 2017 14:36
Two methods to encode and decode base64 strings of text
public static string Base64Encode(string someText)
{
var plainText = System.Text.Encoding.UTF8.GetBytes(someText);
return System.Convert.ToBase64String(plainText);
}
public static string Base64Decode(string someText)
{
var encodedtext = System.Convert.FromBase64String(someText);
return System.Text.Encoding.UTF8.GetString(encodedtext);
}
;;; Emacs Config
;;;; indentation
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(setq c-default-style "linux"
;;; Emacs Config
;;;; indentation
(setq c-default-style "linux"
c-basic-offset 4
sgml-basic-offset 4)
(c-set-offset `inline-open 0)
(setq-default tab-width 4)
@Inkering
Inkering / .vimrc
Created October 3, 2017 16:05
vimrc I like
" A Simple Vimrc
" By Dieter Brehm
" github/Inkering
set nocompatible " be iMproved, requires
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
;;; Emacs Config
;;;; indentation
(setq c-default-style "linux"
c-basic-offset 4
sgml-basic-offset 4)
(c-set-offset `inline-open 0)
(setq-default tab-width 4)
;;;; misc
(setq-default show-trailing-whitespace t)
import math
while(1):
robotLeft = 0
robotRight = 0
x = float(input("Input x \n"))
y = float(input("Input y \n"))
z = float(input("Input z \n"))
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 73 columns, instead of 61 in line 1.
"W","h","e","n"," ","P","i","c","k","i","n","g"," ","A","p","p","l","e","s"," ","o","n"," ","a"," ","F","a","r","m"," ","W","i","t","h"," ","5",",","0","0","0"," ","R","u","l","e","s",","," ","W","a","t","c","h"," ","O","u","t"," ","f","o","r"," ","t","h","e"," ","L","a","d","d","e","r","s"
"A"," ","C","a","m","p","a","i","g","n"," ","M","e","m","o","i","r"," ","T","h","a","t"," ","S","h","o","w","s"," ","T","r","u","m","p",","," ","a","t"," ","L","e","a","s","t"," ","P","a","r","t","l","y",","," ","a","s"," ","H","e"," ","I","s"
"O","n"," ","N","e","w"," ","I","n","d","i","a","n"," ","C","o","n","d","o","s",","," ","t","h","e"," ","N","a","m","e"," ","I","s"," ","T","r","u","m","p",","," ","a","n","d"," ","t","h","e"," ","L","u","r","e"," ","I","s"," ","M","e","e","t","i","n","g"," ","O","n","e"
"‘","T","r","u","m","p"," ","P","l","a","c","e","’"," ","A","s","k","s"," ","i","f"," ","I","t"," ","C","a","n"," ","B","e"," ","C","a","l","l","e","d"," ","b","y"," ","A","n","y"," ","O","t","h","e","r"," ","N","a",
var a = [34, 203, 3, 746, 200, 984, 198, 764, 9];
function bubbleSort(a)
{
var swapped;
do {
swapped = false;
for (var i=0; i < a.length-1; i++) {
if (a[i] > a[i+1]) {
var temp = a[i];
aTrain = [1, 0, 1, 0, 0, 0]
# list as input
# return tuple or length 2 with two lists of resultant trains
def splitTrain(train):
inputTrain = train
inputLength = len(inputTrain)
inputMiddleIndex = inputLength // 2
#!/bin/bash
# This script allows for the quick creation of project directories for quick c++ practicing
#create directory structure
if [ ! -d practice-$1 ]; then
git init practice-$1
mkdir practice-$1/src practice-$1/build practice-$1/includes
cd practice-$1
else