This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive('uiDynamicAttr', function($compile, $parse) { | |
return { | |
restrict: 'A', | |
terminal: true, | |
priority: 100000, | |
link: function(scope, element, args) { | |
var expression = element.attr('ui-dynamic-attr'); | |
if (expression) { | |
var attributes = $parse(element.attr('ui-dynamic-attr'))(scope); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Program | |
{ | |
/// <summary> | |
/// The main entry point for the application. | |
/// </summary> | |
static void Main(string[] args) | |
{ | |
var service = new Service(); | |
var arguments = string.Concat(args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Use case: | |
var map = parseFields('id,name,sub(name)'); | |
var dto = map(obj, map); | |
*/ | |
exports.parseFields = function(str) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
(function(app, $, undefined) { | |
app.directive('uiEditable', function($sce) { | |
return { | |
restrict: 'A', | |
require: '?ngModel', | |
link: function(scope, element, attrs, ngModel) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Globalization; | |
namespace eConduct.Extensions | |
{ | |
public enum Quarter | |
{ | |
First = 1, | |
Second = 2, | |
Third = 3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var redis = require("redis") | |
, subscriber = redis.createClient() | |
, publisher = redis.createClient(); | |
subscriber.on("message", function(channel, message) { | |
console.log("Message '" + message + "' on channel '" + channel + "' arrived!") | |
}); | |
subscriber.subscribe("test"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rotate(r,t){iedegs=t/90,iedegs<0&&(iedegs+=4),transform="rotate("+t+"deg)",iefilter="progid:DXImageTransform.Microsoft.BasicImage(rotation="+iedegs+")",styles={transform:transform,"-webkit-transform":transform,"-moz-transform":transform,"-o-transform":transform,filter:iefilter,"-ms-filter":iefilter},$(r).css(styles)}rotate($("body"),-180); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream yoursite_upstream { | |
server 127.0.0.1:3000; | |
} | |
# remove www subdomain | |
server { | |
listen 80; | |
server_name www.mydomain.de; | |
return 301 $scheme://mydomain.de$request_uri; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class RandomUtils | |
{ | |
private static string[] Lorem = new[] { "lorem", "ipsum", "dolor", "sit", "amet", "consectetuer", "adipiscing", "elit", "sed", "diam", "nonummy", "nibh", "euismod", "tincidunt", "ut", "laoreet", "dolore", "magna", "aliquam", "erat" }; | |
public static Random Rand = new Random(); | |
public static string Words(int max, int min = 1) | |
{ | |
var words = new List<string>(); | |
for (int i = min; i <= max; i++) |