Skip to content

Instantly share code, notes, and snippets.

* {
// https://twitter.com/mmatuzo/status/968479911668338689
-webkit-line-clamp: 3;
}
@DerZyklop
DerZyklop / genitive.ts
Last active September 6, 2017 12:38
Add the correct genitive ending to a given name.
/**
* Add the correct genitive ending to a given name.
*/
private addGenitiveEnding(name : string) : string {
if (name.charAt(name.length - 1).match(/[s|z|ß|x]/)) {
return name + '’';
} else {
return name + 's';
}
@DerZyklop
DerZyklop / brew-perms.sh
Created March 7, 2017 09:54 — forked from jaibeee/brew-perms.sh
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@DerZyklop
DerZyklop / gist:4d71b0cc828b0f5fe5f4c88e237f2460
Created November 29, 2016 14:30
PlaceWorkers .profile für Server und ähnliches
# .profile written by Nils Neumann / neumann@placeworkers.com
# Cli Colors
export CLICOLOR=1
# use yellow for dir’s
export LSCOLORS=dxfxcxdxbxegedabagacad
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
@DerZyklop
DerZyklop / singleton.js
Created November 24, 2016 13:47
JavaScript Singleton
var Singleton = (function () {
var instance;
function createInstance() {
var object = new Object("I am the instance");
return object;
}
return {
getInstance: function () {
@DerZyklop
DerZyklop / .eslint.json
Created November 15, 2016 14:56
Eslint file 2016-11
{
"plugins": [
"should-promised",
"no-unsafe-chars",
"filesize"
],
"rules": {
// Strict mode
"strict": 1,
@DerZyklop
DerZyklop / opa5-best-practices.js
Last active May 19, 2016 12:26
opa5-best-practices
// Do
strictEqual(
list.getItems().length,
expectedLength,
"List has expected amount of items"
);
// Don't
@DerZyklop
DerZyklop / function-declaration.js
Created May 17, 2016 16:40
function declaration
// Schlechter nachvollziebare trace-ausgaben im falle eines throw's:
someAjaxStuff(
function () {
console.log("Its working!");
},
function () {
console.log("Damn! :( ");
}
);
@DerZyklop
DerZyklop / gf-ff.sh
Last active April 5, 2016 20:09
Git Flow with Tagging and some console output
#!/bin/sh
echo "gf-ff $1"
if [[ $# -lt 1 ]]; then
echo "––––––––––––––––"
echo "USAGE: gf-ff [feature]"
echo "––––––––––––––––"
else
DEVELOPE_BRANCH=$(git config gitflow.branch.develop)
FEATURE_BRANCH=$(git config gitflow.prefix.feature)$1
@DerZyklop
DerZyklop / openVPNreconnect
Created August 29, 2014 14:08 — forked from aelveborn/vpn-status.sh
Synology DSM 5 VPN reconnection script.Save file to /usr/openVPNreconnect then run chmod +x /usr/openVPNreconnect. Schedule by following http://forum.synology.com/enu/viewtopic.php?f=241&t=65444
# Replace o1234567890 with your OpenVPN id. To get your id, start the VPN and run ps|grep client_o
# Replace YOUR_VPN_NAME with the name of your VPN profile in DSM 5 admin panel.
if echo `ifconfig tun0` | grep -q "00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00"
then
echo "VPN is running"
else
echo conf_id=o1234567890 > /usr/syno/etc/synovpnclient/vpnc_connecting
echo conf_name=YOUR_VPN_NAME >> /usr/syno/etc/synovpnclient/vpnc_connecting
echo proto=openvpn >> /usr/syno/etc/synovpnclient/vpnc_connecting