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
export default function transformer(file, api) { | |
const j = api.jscodeshift; | |
return j(file.source) | |
.find(j.ImportDeclaration, { | |
source: { | |
value: 'es6-promise' | |
} | |
}) | |
.filter(({node}) => node.specifiers.filter(value => value.local.name === 'Promise').length > 0) |
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
--- | |
version: '2' | |
volumes: | |
pgdata: {} | |
services: | |
db: | |
image: postgres:latest | |
ports: |
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
$ProjectDir = "." | |
$PackagesDir = "$ProjectDir\packages" | |
$OutDir = "$ProjectDir\bin\Debug" | |
# Install NUnit Test Runner | |
$nuget = "$ProjectDir\.nuget\nuget.exe" | |
& $nuget install NUnit.Runners -ExcludeVersion -o $PackagesDir | |
# Set nunit path test runner | |
$nunit = "$ProjectDir\packages\NUnit.ConsoleRunner\tools\nunit3-console.exe" |
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); | |
}); |
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
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
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
$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
[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
public void RemoveById(Guid id) | |
{ | |
_collection.Remove(Query.EQ("_id", id)); | |
} | |
// Using | |
_repository.RemoveById(id); |