Skip to content

Instantly share code, notes, and snippets.

@vladox
vladox / app-script-google-docs-link-replacer.js
Created Jan 8, 2022
Google Docs hyperlinks search & replace
View app-script-google-docs-link-replacer.js
@vladox
vladox / download_sentry_data.py
Last active May 2, 2022 — forked from bubenkoff/download_sentry_data.py
Download all sentry events for a project. Useful for data processing
View download_sentry_data.py
"""Download sentry data.
usage:
python download_sentry_data.py <org>/<project> <api_key>
"""
import requests
import csv
import sys
if __name__ == '__main__':
@vladox
vladox / psql_export_select_to_csv.sql
Last active Nov 3, 2016
Export a SQL query result in Postgres to a CSV file.
View psql_export_select_to_csv.sql
COPY(select * from your_table_name) TO '/the/path/to/your/file/your_table_name.csv' WITH CSV DELIMITER ',' HEADER;
@vladox
vladox / gmail_offline.html
Created Jul 13, 2016
"Google Offline Mail Background Page" Pop-up
View gmail_offline.html
<!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){
View wget website with images
wget -r -p -E -k -e robots=off -U mozilla http://example.com
@vladox
vladox / tidy_xml_lint.py
Last active Dec 23, 2015 — 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/
View tidy_xml_lint.py
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:
@vladox
vladox / EvaluateExtensionModule.cs
Last active Dec 22, 2015
XmlPrime Native Module to dynamically resolve xpath expressions inside a XSLT usage: <xsl:copy-of select="ext:evaluate(.,'./somenode')"/>
View EvaluateExtensionModule.cs
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")]