Skip to content

Instantly share code, notes, and snippets.

View maxfunke's full-sized avatar
🦀

Baron GitGit maxfunke

🦀
View GitHub Profile
@maxfunke
maxfunke / mssql-via-docker.sh
Last active March 22, 2018 18:03
MSSQL via docker (e.g. on OSX)
# pull mssql container
docker pull microsoft/mssql-server-linux
# run container, change password (strong enough) and port
docker run -d --name mssqlOnOSX -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=strongEnoughPassword123' -p 1433:1433 microsoft/mssql-server-linux
# see also:
# https://medium.com/@reverentgeek/sql-server-running-on-a-mac-3efafda48861
@maxfunke
maxfunke / enableHyperV.ps1
Created May 5, 2017 10:52
Installieren von Hyper-V unter Windows 10
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
@maxfunke
maxfunke / consoleColors.js
Created February 2, 2017 09:19
color codes for console.log() in javascript / Node.js
'use strict';
let colorReset = "\x1b[0m"; //reset
let colorCode = (p) => {
if (p >= 100){
return "\x1b[31m"; //red
} else if (p < 100 && p >= 90){
return "\x1b[36m"; //cyan
}
return "\x1b[32m"; //green
@maxfunke
maxfunke / nodePathHandling.js
Created February 2, 2017 09:15
Handling paths for different OS in Node.js - '/' or '\'
'use strict';
const FS = require('fs');
const OS = require('os');
let EXEC_PATH = process.argv[1];
let FILE_PATH = getFilePath(EXEC_PATH);
const FILE = JSON.parse(FS.readFileSync(FILE_PATH + '/myFile.json', 'utf8'));
function getFilePath(execPath){
let splitter = (OS.type() === "Windows_NT") ? "\\" : "/";
@maxfunke
maxfunke / .gitconfig
Last active March 13, 2024 02:21
.gitconfig aliases (adog, log, status)
[alias]
adog = log --all --decorate --oneline --graph
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
st = status --short
b = branch -vv
[core]
editor = code --wait
autocrlf = input
@maxfunke
maxfunke / DS_Store_disable
Created April 17, 2015 14:57
Disable .DS_Store file creation for OSX
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
@maxfunke
maxfunke / serialport
Created December 4, 2014 19:46
Serialport w/ Node.js. Parses Strings (send by Arduino).
var serialport = require("serialport");
var SerialPort = serialport.SerialPort;
var port = "/dev/tty.usbmodem1411";
var sp = new SerialPort(port, {
parser: serialport.parsers.readline("\n")
});
sp.on("data", function (data) {
console.log(data);
@maxfunke
maxfunke / comandLineTool
Last active August 29, 2015 14:06
update OSX Terminal w/o XCode
xcode-select --install
@maxfunke
maxfunke / gulpfile.js
Last active August 29, 2015 14:02
my gulpfile.js [sass, concat, autoreload]
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
connect = require('gulp-connect');
gulp.task('sass', function () {
gulp.src('./scss/*.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(gulp.dest('./css/tmp/'))
@maxfunke
maxfunke / vector.cpp
Created May 23, 2014 18:45
Vector usage in c++
// init vector
vector <int> myVec(10);
//size of vector
int vSize = myVec.size();
// access to element n
myVec[0] = 1; // no buffer checking
myVec.at(1) = 2;
// resize vector
myVec.push_back(11); // extends vector by 1 and give it value of parameter
myVec.resize(myVec.size()+1); // extends vector by 1 and initializes last element with 0