Skip to content

Instantly share code, notes, and snippets.

module.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.on('click', function () {
this.select();
});
}
};
});
@wolfg1969
wolfg1969 / public_ip.config
Created April 7, 2014 01:05
set public ip for elastic beanstalk
Resources:
AWSEBAutoScalingLaunchConfiguration:
Type: "AWS::AutoScaling::LaunchConfiguration"
Properties:
"AssociatePublicIpAddress" : "true"
@wolfg1969
wolfg1969 / const.py
Created July 28, 2014 11:42
Constants in Python
# http://code.activestate.com/recipes/65207-constants-in-python/?in=user-97991
class _const(object):
class ConstError(TypeError):
pass
class ConstCaseError(ConstError):
pass
@wolfg1969
wolfg1969 / mysql2mongo.py
Created October 1, 2014 03:40
import mysql tables into mongodb
#!/bin/env python
import sys
from decimal import Decimal
from optparse import OptionParser
from pymongo import MongoClient
from pymongo.son_manipulator import SONManipulator
import MySQLdb
import MySQLdb.cursors
tell application "System Events"
-- get current clipboard contents as a string
set CurrentClipboard to the clipboard as string
-- set the clipboad to your password
set the clipboard to "Y0urVPNPa$$w0rd"
-- start playing with the VPN
tell current location of network preferences
<html>
<head>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div id="sound-on" class="music">
<div id="bar1"></div>
<div id="bar2"></div>
<div id="bar3"></div>
</div>
@wolfg1969
wolfg1969 / script.sh
Created September 5, 2012 10:45 — forked from kapkaev/script.sh
centOS gitosis
#step 1
yum -y install python-setuptools
#step 2
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# or
# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
#step 3
# if you using centOS 6.2 enable rpmforge-extras (enabled =1)
@wolfg1969
wolfg1969 / tunnel.conf
Created September 6, 2012 07:05
autossh upstart conf
# tunnel - secure tunnel to my vps
description "ssh tunnel"
start on (local-filesystems and network-device-up IFACE!=lo)
stop on runlevel [!12345]
respawn
respawn limit 5 60 # respawn max 5 times in 60 seconds
umask 022
@wolfg1969
wolfg1969 / nginx.conf
Created September 7, 2012 09:58
ngx_set_misc example: redirect to a url specified by query parameter.
location /go {
set_unescape_uri $new_url $arg_url;
if ( $new_url ~* ^[^(http://)](.*)$ ){
return 302 http://$new_url;
}
return 302 $new_url;
}
@wolfg1969
wolfg1969 / maven-assembly-plugin.xml
Created September 14, 2012 02:08
maven pom samples
<project>
...
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<finalName>uis-server</finalName>
<descriptors>