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
workers_list=$(bosh vms --json | jq '.Tables | .[0].Rows | map(.[0])' | grep worker | tr -d "\",\ ") | |
echo "Recreating following workers: " | |
echo "$workers_list" | |
while read -r worker; do | |
bosh recreate -f "$worker" | |
done <<< "$workers_list" |
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 {Checkout, Submodule, Repository} = require("nodegit"); | |
Repository.open("/native-repo") | |
.then(function(repository) { | |
return repository.getTagByName("v1.0.8") | |
.then(function(result) { console.dir(result); return result; }) | |
.then(function(tag) { console.dir([tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()]); return tag; }) | |
.then(function(tag) { repository.setHeadDetached(tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()) }) | |
}) | |
.then(function() { console.log("done");}) | |
.done() |
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
require 'open-uri' | |
doc = Nokogiri::HTML(URI.open("https://www.oscars.org/oscars/ceremonies/2022")) | |
doc.css(".view-grouping-header h2") |
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 updateSubmodulesRecursevly(repository, cloneOptions) { | |
return repository.getSubmoduleNames().then(function(names) { | |
return names.reduce(function(promiseChain, name) { | |
return promiseChain.then(function() { | |
return new Promise(function(resolve, reject) { | |
Submodule.lookup(repository, name) | |
.then(function(submodule) { | |
return submodule.init(1) | |
.then(function(result) { | |
return submodule.update(1, cloneOptions) |
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
<?php | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "YOUR_INTEGRATION_URL", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 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
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "activerecord", require: "active_record" | |
gem "activejob", require: "active_job" | |
gem "sqlite3" | |
gem "searchkick", git: "https://github.com/ankane/searchkick.git" | |
end |
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
curl -X GET http://localhost:4567 |
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
Xcloud@xcloud199 ~> cat /Library/LaunchDaemons/monit.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>monit</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/bin/monit</string> |
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 url = 'http://localhost:8081/api/v2/deliverable_builds/6db57828-01b5-11e8-a40f-685b358e6aa5' | |
var idExtractor = /([\d\w\-]+)$/g; | |
var idMatch = idExtractor.exec(url); | |
console.log(idMatch[1]); | |
var typeExtractor = /\/([\w\d\_]+)\/[\d\w\-]+$/g; | |
var typeMatch = typeExtractor.exec(url); | |
console.log(typeMatch[1]); |
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
require "faker" | |
puts (1..13).map { |i| {name: Faker::RickAndMorty.character, bio: Faker::RickAndMorty.quote, number: rand(1000..9999), is_alive: [true, false].sample} }.reduce({}) {|res, obj| res[obj[:name]] = obj; res }.to_yaml |
NewerOlder