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
cat pages.txt | xargs -n1 curl -I |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace System.Collections.Generic | |
{ | |
public static class SampleCollectionExtension | |
{ | |
private static readonly Random Random = new Random(); |
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 static class ShortenStringExtension | |
{ | |
public static string Shorten(this string input, int maxLength) | |
{ | |
if (string.IsNullOrEmpty(input)) | |
return input; | |
return input.Length <= maxLength ? input : input.Substring(0, maxLength); | |
} | |
} |
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
#--------------------------------------------------------------------------------- | |
# This script is an addition to the AddingTrustedRanges.ps1 script provided by Microsoft | |
#--------------------------------------------------------------------------------- | |
#requires -version 2.0 | |
<# | |
.SYNOPSIS | |
The PowerShell script which can be used to add trusted IP ranges in Internet Explorer. | |
.DESCRIPTION |
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
<script type="text/javascript"> | |
// This is a modified version of the script Davin Studer from | |
// http://iamdav.in/2014/10/24/bookmarklet-creating-csv-html-table/ | |
// I added in a BOM mark to allow for non-english table contents export as well as | |
// wrapped it in a script snippet to be appended at them end of a confluence page in a html block | |
function downloadCSVFile(filename, mime, text) { | |
if (window.navigator.msSaveOrOpenBlob){ | |
// IE 10+ | |
var blob = new Blob([decodeURIComponent(encodeURI(text))], { | |
type: 'text/csv;charset=utf-8' |
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
<script type="text/javascript"> | |
// first up, let's tag everything | |
jQuery("table.confluenceTable tr td:nth-child(4)").each(function(e){ | |
var col = jQuery(this); | |
var text = col.text(); | |
var encodedId = text.replace(/[^A-Za-z\d]/g, '_'); | |
col.attr("id", encodedId); | |
col.html('<a href="#' + encodedId + '">' + col.text() + '</a>'); | |
}); |
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
<script type="text/javascript"> | |
// add linked anchors to all the headers | |
jQuery("#content h1, #content h2, #content h3").each(function(e){ | |
var header = jQuery(this); | |
var text = header.text(); |
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
#!/bin/bash | |
# Helper to modify a file modification date in case timezone is wrong. | |
# I noticed that when moving files from my camera whilst travelling the time zone was off and needed to bulk adjust them. | |
# Written and tested on osx bash, in GNU this script is superfluous since touch can do a relative -d '-2 hours' flag which osx shell doesn't support.. | |
set -euo pipefail | |
SCRIPT_NAME=`basename "$0"` | |
# helper to log to stderr |
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
const fs = require('fs') | |
const exec = require('child_process').execSync | |
// SUMMARY: | |
// This simple script uses gtranslate npm cli tool to translate an input file | |
// of countries in json format to another format with translated country names | |
// the expected input would be [ { "country": "name" } ] | |
let inputCountries = JSON.parse(fs.readFileSync('countries.json')) |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"> | |
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg)"> | |
<scene id="scene1" width="450"> | |
<label t="translate(0,346)"> |