Skip to content

Instantly share code, notes, and snippets.

View yasirjanjua's full-sized avatar
🎯
Focusing

Yasir Janjua yasirjanjua

🎯
Focusing
  • Lahore,Pakistan
View GitHub Profile
@azinneera
azinneera / uuid-gen.xslt
Last active February 12, 2024 10:17
XSLT generate unique UUID
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:uuid="http://www.uuid.org" version="2.0">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<Payment xmlns="http://ws.apache.org/ns/synapse">
<xsl:for-each select="//Order/lunch">
<discount>
<li>
<xsl:attribute name="uid" select="uuid:get-uuid(drinkName)"/>
<xsl:value-of select="drinkName"/>
<span>
@bcnzer
bcnzer / postman-pre-request.js
Last active April 30, 2024 21:20
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@dfontana
dfontana / CmderZSH.md
Last active March 12, 2023 21:45
My setup guide for installing Cgywin, Mintty, Cmder, and ZSH.

What's this?

Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.

The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.

Why is this here?

For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.

What exactly is covered?

  • Installing and setting up cmder
#!/bin/bash
if [ "$#" -ne 3 ]; then
echo "usage: sh thread-analyze.sh <pid> <number-of-dumps> <interval>"
exit
fi
count=$2
for i in `seq 1 $count`;
do
jstack -l $1 > thread_dump_`date "+%F-%T"`.txt &