Skip to content

Instantly share code, notes, and snippets.

Stefan Urbansky urbansky

Block or report user

Report or block urbansky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ISO8601.groovy
import java.text.DateFormat
import java.text.SimpleDateFormat
TimeZone tz = TimeZone.getTimeZone("Europe/Berlin") // Change the timezone
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmX") // X is the timezone in ISO8601
String iso8601 = df.format(new Date())
urbansky / filter-string.js
Created May 31, 2016
Remove all special characters so a string can be used as valid filename
View filter-string.js
// Replace all special characters with empty string
var filename = stringToFilter.replace(/[^\w\s\-\.]/gi, '')
// ^ Negation
// \w alpha numeric
// \s spaces
// /gi search global and case insensitive
urbansky / format date.js
Created May 31, 2016
Format a Javascript 'Date'-Object
View format date.js
// Use Moment.js
// see:
moment().format("YYYY-MM-DD_HHmm") // '2016-05-31_1543'
urbansky /
Last active Jun 29, 2016
CentOS commands
# Start|Stop network devices
# configuration in '/etc/sysconfig/network-scripts'
ifup eth0
ifdown eth0
service network start (start|stop|restart)
# Edit init-scripts
urbansky / inject.js
Created Jul 7, 2016
Inject JQuery to a page in ChromeDeveloper Tools
View inject.js
// run in console
// see:
var script = document.createElement('script');script.src = "";document.getElementsByTagName('head')[0].appendChild(script);
urbansky /
Last active Jul 25, 2016
Keyboard shortcuts
urbansky /
Last active Aug 29, 2016
common git parameter
# Show current branch
git status
# Change branch
git checkout branch_name
# Get all new remote branches
git fetch --all
urbansky /
Last active Jan 18, 2017
Ubuntu commands
# Set the timezone
dpkg-reconfigure tzdata
# Add init script
# Ubuntu 14.04
update-rc.d tomcat defaults
# -------------------------
# Package manager
# -------------------------
urbansky / search_github
Created Mar 7, 2017
Search GitHub examples
View search_github
# Search for Grails projects that uses the platform-core plugin
platform-core path:grails-app/conf filename:BuildConfig.groovy
urbansky /
Last active Mar 7, 2017
Install Java on Ubuntu
# install the commando 'add-apt-repository'
apt-get install software-properties-common
# see:
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java8-installer
# JAVA_HOME is '/usr/lib/jvm/java-8-oracle/'
You can’t perform that action at this time.