Instantly share code, notes, and snippets.

View cloudSettings
{"lastUpload":"2018-12-11T23:03:04.878Z","extensionVersion":"v3.1.2"}
View gist:d65e9d43ad557f3338c1537488b2c1d5
sed '/abc/d' input.file
git ls-files -z | xargs -0 sed -i -e 's/foo/bar/g'
View drawio2rails
#!/usr/bin/ruby
integer_attributes = ["order", "progress"]
require "nokogiri"
x = Nokogiri::XML File.read "swift3_db.xml"
referencing = x.xpath("//mxCell").find_all{|e| e["source"]}.collect{|e| e["source"]}
p referencing.sort
result = {}
x.xpath("//mxCell").find_all{|e| e["parent"] == "1" && !e["target"]}.each do |model|
View 720p.1080p
<item>
<title></title>
<link></link>
<thumbnail></thumbnail>
<fanart></fanart>
<info></info>
<genre> </genre>
</item>
sublink:#
View cachedAjaxIntervalExample.js
fromCache('itemList')
.pipe(
switchMap(itemList => (
interval(3600000)
.pipe(
startWith(0),
switchMap(() => (
ajax({
url: 'https://api.example.com/data',
})
View fix-bind-options.sh
# This error happens when dnsmasq tries to start on a host that:
# 1) Is running the bind9.service (named)
# 2) Host's /etc/bind/named.conf.options is missing or has "any" set for listen-on[-v6] declarations.
#
# named creates a listener for the virtual ethernet that conflicts with the lisenter created by dnsmasq
#
# Fix is to tell named to only listen on physical nics
#
# The function below tries to determine phyical nics and edits /etc/bind/named.conf.options accordingly
View untrusted-lvl11-solution.js
/*
* robot.js
*
* You'll need three keys in order to unlock the
* Algorithm: the red key, the green key, and the
* blue key. Unfortunately, all three of them are
* behind human-proof barriers.
*
* The plan is simple: reprogram the maintenance
* robots to grab the key and bring it through
View Dockerfile
FROM php:7.2-fpm-alpine
RUN apk update && apk upgrade
RUN apk add php7 php7-fpm php7-opcache \
php7-gd php7-mysqli php7-zlib \
php7-curl php7-bcmath php7-zip \
php7-dom php7-mbstring php7-fileinfo \
php7-tokenizer php7-xml php7-xmlwriter \
php7-iconv php7-intl php7-ctype \
php7-ftp php7-sodium \
php7-amqp php7-mongodb php7-pcntl \
View TestClass.cs
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
namespace MedioTestFunctional
View openpanzer-save.json
{"scenario":{"name":"Closing in on Dunkirk","maxTurns":27,"date":"1940-05-26T04:00:00.000Z","atmosferic":0,"latitude":2,"ground":0,"turnsPerDay":0,"dayTurn":0,"reinforcements":{"2":[{"row":23,"col":13,"unit":{"eqid":346,"id":-1,"owner":1,"hasMoved":false,"hasFired":false,"hasResupplied":false,"isMounted":false,"isSurprised":false,"isDeployed":false,"isCore":false,"tempSpotted":false,"strength":10,"facing":1,"flag":23,"destroyed":false,"player":null,"transport":{"eqid":1942,"ammo":12,"fuel":0,"icon":"resources/units/images/h43.png"},"carrier":0,"moveLeft":3,"ammo":6,"fuel":0,"hasAnimation":false,"hits":0,"experience":107,"entrenchment":3,"entrenchTicks":0,"leader":-1},"turn":"2","id":1},{"row":23,"col":26,"unit":{"eqid":338,"id":-1,"owner":1,"hasMoved":false,"hasFired":false,"hasResupplied":false,"isMounted":false,"isSurprised":false,"isDeployed":false,"isCore":false,"tempSpotted":false,"strength":10,"facing":0,"flag":23,"destroyed":false,"player":null,"transport":{"eqid":382,"ammo":0,"fuel":100,"icon":"resour