Skip to content

Instantly share code, notes, and snippets.

@vladox
vladox / EvaluateExtensionModule.cs
Last active December 22, 2015 11:28
XmlPrime Native Module to dynamically resolve xpath expressions inside a XSLT usage: <xsl:copy-of select="ext:evaluate(.,'./somenode')"/>
using System.Collections.Generic;
using System.Xml.Schema;
using System.Xml.XPath;
namespace XmlPrime.Samples.XsltModule
{
[XdmModule("http://www.xmlprime.com/xpath")]
public class EvaluateExtensionModule
{
[XdmFunction("evaluate")]
@vladox
vladox / tidy_xml_lint.py
Last active December 23, 2015 07:29 — forked from dbaltas/tidy_xml_lint.py
Sublime Text 3 Xml Prettifier Plugin. Created by André Bergonse http://www.bergspot.com/blog/2012/05/formatting-xml-in-sublime-text-2-xmllint/
import sublime, sublime_plugin, subprocess
class TidyXmlLintCommand(sublime_plugin.TextCommand):
def run(self, edit):
command = "XMLLINT_INDENT='\t' xmllint --format --encode utf-8 -"
# help from http://www.sublimetext.com/forum/viewtopic.php?f=2&p=12451
if self.view.sel()[0].empty():
xmlRegion = sublime.Region(0, self.view.size())
else:
wget -r -p -E -k -e robots=off -U mozilla http://example.com
@vladox
vladox / gmail_offline.html
Created July 13, 2016 10:40
"Google Offline Mail Background Page" Pop-up
<!DOCTYPE html>
<html manifest="https://mail.google.com/mail/mu/background/manifest?mui=ca&amp;msui=sync">
<head>
<title>Google Offline Mail Background Page</title>
</head>
<body>
<script>
var h,aa=function(){},k=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b},q=function(a){var b=k(a);return"array"==b||"object"==b&&"number"==typeof a.length},r=function(a){return"string"==typeof a},ba=function(a,b,c){return a.call.apply(a.bind,arguments)},ca=function(a,b,c){
@vladox
vladox / psql_export_select_to_csv.sql
Last active November 3, 2016 11:25
Export a SQL query result in Postgres to a CSV file.
COPY(select * from your_table_name) TO '/the/path/to/your/file/your_table_name.csv' WITH CSV DELIMITER ',' HEADER;
@vladox
vladox / download_sentry_data.py
Last active November 16, 2023 19:30 — forked from bubenkoff/download_sentry_data.py
Download all sentry events for a project. Useful for data processing
"""Download sentry data.
usage:
python download_sentry_data.py <org>/<project> <api_key>
"""
import requests
import csv
import sys
if __name__ == '__main__':
@vladox
vladox / app-script-google-docs-link-replacer.js
Created January 8, 2022 21:15
Google Docs hyperlinks search & replace