Skip to content

Instantly share code, notes, and snippets.

@naxmefy
naxmefy / whenactive directive
Created November 22, 2013 20:16
Angular Directive for Menu State to Set Class Attributes or else to identify if it is active. Works with mainnavs and subitems. only add directive "when-active" to menuitems
.directive('whenActive',
[
'$location',
($location)->
scope: true,
link: (scope, element, attr)->
scope.$on '$routeChangeSuccess',
() ->
loc = "#"+$location.path()
href = element.attr('href')
@naxmefy
naxmefy / FirstChild.java
Created March 25, 2014 09:20
vererbung ohne konstruktor??
public class FirstChild extends Parent
{
private String color;
public FirstChild(String color)
{
this.color = color;
}
@naxmefy
naxmefy / gist:7ea3533e08110f8eef49
Created May 6, 2014 20:10
Add Sublime to CMD (windows)
# First
# cd "C:\Program Files\Sublime Text 2\"
# Second
# mklink subl.exe sublime_text.exe
# Third
# Add "C:\Program Files\Sublime Text 2\" to PATH
# Use it
## Server configuration for nginx to host Atlassian Jira / Jetbrain TeamCity or any other Tomcat web application
#
# author cedric.walter, www.waltercedric.com
# to be saved for ex in /etc/nginx/sites-available/example
server {
listen 80;
server_name jira.example.com;
access_log off;
location / {
@naxmefy
naxmefy / mit-coffee-copyright.sublime-snippet
Last active August 29, 2015 14:07
MIT CoffeeScript Snippet for Sublime
@naxmefy
naxmefy / StringManipulation.js
Last active August 29, 2015 14:17
Unity3D StringManipulation (Format) like Underscore template
#pragma strict
import System.Text.RegularExpressions;
public class StringManipulation {
private static var interpolate : String = "\\{(.+?)\\}";
/**
* Example use: StringManipulation.Format("{name} {weather}", {
"name": "Tom",
@naxmefy
naxmefy / English.js
Last active January 2, 2022 21:03
Unity3D Internationalization (I18N)
#pragma strict
public class English {
public static var lang : Hashtable = {
// General
"game_name": "My Awesome Game"
// Menus
, "new_game" : "New Game"
, "save_game" : "Save Game"
@naxmefy
naxmefy / 0_reuse_code.js
Created July 16, 2016 20:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
if (window.location.protocol !== 'https:') {
window.location = 'https://' + window.location.hostname + window.location.pathname + window.location.hash;
}
@naxmefy
naxmefy / c9-java8.sh
Last active July 22, 2020 01:04
setup java8 on cloud9
# Install Java.
sudo echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update -y
sudo apt-get install -y oracle-java8-installer
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /var/cache/oracle-jdk8-installer
# Define commonly used JAVA_HOME variable and update PATH
echo 'export JAVA_HOME=/usr/lib/jvm/java-8-oracle' >> ~/.bashrc