Skip to content

Instantly share code, notes, and snippets.

## Confluence -> General configuration -> User Macros -> Create a User Macro
##
## Definition of User Macro -> Macro Body Processing -> No macro body
## Definition of User Macro -> Template -> (Use below code snippet including ## @param ...)
## @param space:title=Space|type=spacekey
<div style="">
<a href="/confluence/pages/createblogpost.action?spaceKey=$paramspace" class="aui-button">
<span>Create News Post</span>
</a>
@trgraglia
trgraglia / async.py
Created July 17, 2018 14:53 — forked from hemanth/async.py
Async subprocess execution in python.
import sys
from subprocess import PIPE, Popen
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x
ON_POSIX = 'posix' in sys.builtin_module_names
@trgraglia
trgraglia / gist:53f8b3fb3af7286c4f4d
Created February 24, 2016 16:50 — forked from tobek/get-image-urls.js
Save images from chrome inspector network tab
/* right click on an entry in the network log, select Copy All as Har
* type in console: x = [paste]
* paste the following JS code into the console
* copy the output, paste into a file
* then wget -i [that file]
*/
(function(logObj, mime) {
var results = [];
logObj.log.entries.forEach(function (entry) {
if (mime && entry.response.content.mimeType !== mime) return;
@trgraglia
trgraglia / mobile-media-queries.css
Last active April 6, 2017 18:27
Common mobile device media queries.
/* NOTES: This is my personal collection which I plan to try and keep */
/* up to date. There are a lot of snippets around the web but seem to */
/* rarely be a whole collection to choose from. */
/* ALL INPUT AND FEEDBACK WELCOME! */
/* iPad Mini - 1024x768, 163ppi. http://www.apple.com/ipad-mini/specs/ */
/* iPhone 5 - 1136x640, 326 ppi. http://www.apple.com/iphone/specs.html */
/* iPad '4' - 2048x1536, 264 ppi. http://www.apple.com/ipad/specs/ */
/* iPhone 4 - Actual: 960x640, Logical: 480x320. http://www.iphoneresolution.com/ */
@trgraglia
trgraglia / SPQueryHandler.cs
Last active December 11, 2015 22:49
SPQueryHandler for easily creating SharePoint SPQuery queries.
using System.Collections.Generic;
using System.Linq;
using Microsoft.SharePoint;
namespace slnNamespace
{
/// <summary>
/// An enumeration of the different operators.
/// </summary>
/// <remarks>