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.Collections.Generic; | |
using System.Linq; | |
using NUnit.Framework; | |
using Newtonsoft.Json; | |
namespace Web.Test | |
{ | |
public class Class1 | |
{ | |
public Class1(string name, IEnumerable<string> names, IEnumerable<Class2> classes) |
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
Push-Location c:\nginx | |
.\nginx.exe -s stop | |
$started = ps nginx* | |
while($started) { | |
Start-Sleep 1 | |
$started = ps nginx* | |
} | |
Push-Location logs | |
$timestamp = (Get-Date).ToString("dd.MM.yyyy_HH.mm.ss") | |
$location = Get-Location |
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
FeedParser = require "feedparser" | |
request = require "request" | |
fs = require "fs" | |
args = process.argv.slice(2) | |
process.exit(1) if args.length is 0 | |
req = request(args[0]) | |
feedparser = new FeedParser() |
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 void RemoveById(Guid id) | |
{ | |
_collection.Remove(Query.EQ("_id", id)); | |
} | |
// Using | |
_repository.RemoveById(id); |
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
[program:sample] | |
command=coffee index.coffee | |
user=deployer | |
stdout_logfile=/var/projects/sample/logs/supervisor/access.log | |
stderr_logfile=/var/projects/sample/logs/supervisor/error.log | |
directory=/var/projects/sample/server/ | |
autostart=true | |
autorestart=true | |
redirect_stderr=true | |
environment=NODE_ENV=production |
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
$buildId = 10048 | |
$teamcityUrl = "http://teamcity:8080" | |
$auth = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("username:password")) | |
@((Invoke-RestMethod $teamcityUrl/httpAuth/app/rest/changes?build=id:$buildId -Headers @{"Authorization" = "Basic $auth"}).changes.change) | % { (Invoke-RestMethod $teamcityUrl/httpAuth/app/rest/changes/id:$($_.id) -Headers @{"Authorization" = "Basic $auth"}).change.comment} |
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
fs = require 'fs' | |
path = require 'path' | |
routes = fs.readdirSync('./server/controllers').map (f) -> | |
path.basename(f, path.extname(f)) | |
addRouter = (app, name) -> | |
name = name.replace 'index', '' | |
app.use '/' + name, require './controllers/' + name |
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
save=true | |
save-exact=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
gci | Select-String "\s502\s|\s504\s" | %{$_ -match 'GET (.*) HTTP/1.1'} | foreach { $matches[1] }| group-object -noelement | Where-Object {$_.Name -notlike "*solr*"} | Sort-Object Count -Descending | % {"{0} {1}" -f $_.Count, $_.Name} | Out-File result.txt |
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 urls = []; | |
var tasks = urls.map(function(url) { | |
return $.getJSON(url); | |
}); | |
var lastPromise = urls.reduce(function(promise, url) { | |
return promise.then(function() { | |
return $.ajax(url); | |
}); |