Skip to content

Instantly share code, notes, and snippets.

View janeklb's full-sized avatar

Janek Lasocki-Biczysko janeklb

View GitHub Profile
@janeklb
janeklb / nmcli_vpn.bash
Created August 21, 2021 17:15
Importin openvpn connections into network manager on (x)ubuntu
# install openvpn network manager
# `network-manager-openvpn-gnome` is required for password management + interation with keyring
sudo apt install network-manager network-manager-openvpn network-manager-openvpn-gnome
# import .ovpn file into network manager
nmcli connection import type openvpn file <PATH-TO-OVPN-FILE>
# set username
nmcli connection modify openvpn-connection +vpn.data username=<USERNAME>
# set password
nmcli connection modify openvpn-connection +vpn.secrets password=<PASSWORD>
@janeklb
janeklb / .bash_profile
Created August 3, 2017 12:35 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@janeklb
janeklb / deploy.sh
Last active December 24, 2015 10:49
Easy peezy deploy from a git repo using rsync
#!/bin/sh
# heavily inspired by http://wildlyinaccurate.com/deploying-a-git-repository-to-a-remote-server (and comments)
ref=master # git ref
prefix=deploy_in_prog/ # just a temp name
tmp_dir=/tmp
remote_dir=/var/www # the remote directory
remote_host=user@host # the remote host
@janeklb
janeklb / gist:5546011
Last active December 17, 2015 03:49
AngularJS '&' directive scope - 2
<div ng-app="myApp" ng-controller="myController">
<div my-clicky my-click-action="doStuff(number)"></div>
</div>
@janeklb
janeklb / gist:5544464
Last active December 17, 2015 03:38
AngularJS '&' directive scope - 1
<div ng-app="myApp" ng-controller="myController">
<div my-clicky my-click-action="doStuff()"></div>
</div>
@janeklb
janeklb / gist:4761535
Last active September 4, 2020 13:59
PHP: array to object
<?php
# Simple loop copy
function loop_copy($array) {
$object = new stdClass();
foreach ($array as $key => $value) {
$object->$key = $value;
}
}
@janeklb
janeklb / gist:4650320
Created January 27, 2013 20:33
create javascript date objects using date strings, in the user's timezone
function dateInLocalTimezone(simpleDateString) {
var date = new Date(simpleDateString), millis = date.getTime();
date.setTime(millis + date.getTimezoneOffset() * 60 * 1000);
return date;
}
@janeklb
janeklb / gist:2761327
Created May 21, 2012 09:04
Bootstrap (v2.0.3) tooltip issue
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" />
</head>
<body style="padding: 60px 0;">
<div style="float:right;">
<a class="btn tt" title="Yaaaaaaaaaaay, this longer tooltip works.. kinda">:)</a>
<a class="btn tt" title="Boooooooooooo, this longer tooltip is broken..">:(</a>