Shortened URL to access this gist: http://tiny.cc/swarmgs
All scripts work in bash and should work in powershell except as noted
git clone https://gist.github.com/g0t4/1454ee7342d54aba5313ffc699d472ba local-folder
//Easier to just pull the file collection and edit the files documents, just be careful, example: | |
public void SaveMetadata(string id, MetadataJson metadata) | |
{ | |
var gridFs = FilesContext.GetGridFs(); | |
var files = gridFs.Database.GetCollection(gridFs.Settings.FilesCollectionName); | |
var file = files.FindOneById(new BsonObjectId(id)); | |
var metadataDocument = file["metadata"].AsBsonDocument; | |
metadataDocument.Set("comment", metadata.comment ?? string.Empty); |
[Test] | |
public void METHOD_SCENARIO_EXPECTATION() | |
{ | |
var path = @"..\..\..\View.spark"; | |
var code = File.ReadAllLines(path); | |
for (int lineNumber = 0; lineNumber < code.Length; lineNumber++) | |
{ | |
var line = code[lineNumber]; | |
var classControlLabel = "class=\"control-label\""; | |
if(line.Contains(classControlLabel)) |
require(['knockout', 'jquery.elastic'], function (ko) { | |
ko.bindingHandlers.elastic = { | |
// todo probably should make this destroy when the element is destroyed. | |
update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { | |
$(element).elastic(); | |
} | |
} | |
}); |
// FYI YMMV this was just a first pass and I know it has some issues at times that I need to workout | |
// usage | |
// source: a function that takes the query (text entered by user) and a callback (process), if source is synchronous it should return the results and ignore the callback, otherwise it should return nothing and use the callback to return the results | |
// selectedId: the model property to bind the id to | |
// value: the model property to bind the text value of the selection to | |
// data-bind="typeahead: { source: App.view.targets.typeAheadSource, selectedId: target._id }, value: target.name" | |
// note I also use this little helper class to wrap up all this functionality | |
// it takes a url to query the results for asynchrnous data sets and has an init method to call to query the data initially. |
[Test] | |
[Timeout(2000)] | |
public async Task WriteToFile_StreamsChanged() | |
{ | |
using (var watcher = new ObservableFileSystemWatcher(c => { c.Path = TempPath; })) | |
{ | |
var firstChanged = watcher.Changed.FirstAsync().ToTask(); | |
watcher.Start(); | |
File.WriteAllText(Path.Combine(TempPath, "Changed.Txt"), "foo"); |
#!/bin/bash | |
wget https://gist.githubusercontent.com/g0t4/c4d382b0aa0b15ed3454f501d2102500/raw/c39c6662fa15e4ad9c842eae9e2724dd1810d7eb/table.adoc | |
# this docker image comes preloaded with many extensions! https://hub.docker.com/r/asciidoctor/docker-asciidoctor/~/dockerfile/ | |
# docs for asciidoctor-diagram extension http://asciidoctor.org/docs/asciidoctor-diagram/ | |
# volume mount for current working directory, to ready table.adoc and write resultant output file | |
# function to hide away the docker run and volume plumbing, treat like it is installed locally :) | |
asciidoctor() { docker run --rm -v $(pwd):/documents asciidoctor/docker-asciidoctor asciidoctor "$@" ; } |
Shortened URL to access this gist: http://tiny.cc/swarmgs
All scripts work in bash and should work in powershell except as noted
git clone https://gist.github.com/g0t4/1454ee7342d54aba5313ffc699d472ba local-folder
Access this gist via: https://git.io/vPnaU GitHub repo: https://git.io/vP819 (https://github.com/g0t4/pluralsight-dotnet-core-windows/)
Links:
version: '2' | |
services: | |
teamcity: | |
image: sjoerdmulder/teamcity | |
ports: | |
- 8111:8111 | |
teamcity-agent: | |
image: sjoerdmulder/teamcity-agent | |
environment: |