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
import subprocess | |
import json | |
import sys | |
def parse_version(version_str): | |
try: | |
# Remove any non-numeric characters like '^' or '~' | |
return [int(x) for x in version_str.replace('^', '').replace('~', '').split('.')] | |
except ValueError: | |
# Handle non-numeric versions differently or skip them |
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
FROM ubuntu:18.04 | |
LABEL maintainer="[email protected]" | |
LABEL version="0.1" | |
LABEL description="This is custom image for node projects development" | |
# Disable prompt during packages installation | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Update repository and install all common required bits and pieces |
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
namespace SerilogTest | |
{ | |
using System; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
public class Program | |
{ | |
public static void Main(string[] 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
<rule name="Whitelist IPs" patternSyntax="Wildcard" stopProcessing="true"> | |
<match url="*" /> | |
<conditions> | |
<add input="{REMOTE_ADDR}" pattern="212.203.321.40" negate="true" /> | |
<add input="{REMOTE_ADDR}" pattern="5.13.161.12" negate="true" /> | |
</conditions> | |
<action type="AbortRequest" /> | |
</rule> | |
<rule name="WWW to non WWW" stopProcessing="true"> |
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++) |
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
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
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
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
'use strict'; | |
(function(app, $, undefined) { | |
app.directive('uiEditable', function($sce) { | |
return { | |
restrict: 'A', | |
require: '?ngModel', | |
link: function(scope, element, attrs, ngModel) { |
NewerOlder