Skip to content

Instantly share code, notes, and snippets.

@sushengloong
sushengloong / gist:9777409
Created March 26, 2014 05:36
Send Android exception stack trace via email
try {
// your buggy code here
// ......
} catch (Exception e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
String errors = sw.toString();
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{"youremail@gmail.com"});
email.putExtra(Intent.EXTRA_SUBJECT, "[Android] Crash Report");
@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active March 29, 2024 02:29
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
@dougpuob
dougpuob / CryptQueryObject.c
Created May 16, 2017 06:14
How To Get Information from Authenticode Signed Executables
/*
# How To Get Information from Authenticode Signed Executables
https://support.microsoft.com/en-us/help/323809/how-to-get-information-from-authenticode-signed-executables
## Summary
You can use the WinVerifyTrust() API to verify an Authenticode signed executable.
Although a signature is verified, a program may also have to do the following:
@MHaggis
MHaggis / handlers
Created June 2, 2022 19:06
Get-Item Registry::HKEY_CLASSES_ROOT\* | Select-Object "Property","PSChildName" | Where-Object -Property Property -Match "^URL*" | Export-Csv -path c:\temp\url_all.csv
bingmaps
calculator
callto
conf
DLNA-PLAYSINGLE
Explorer.AssocActionId.BurnSelection
Explorer.AssocActionId.EraseDisc
Explorer.AssocActionId.ZipSelection
Explorer.AssocProtocol.search-ms
Explorer.BurnSelection
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
#!/bin/bash
set -e -o errexit -o pipefail -o nounset
###################################
# This script can be used by itself, but it's recommended that you read
# a tutorial on Proxmox forum first: https://forum.proxmox.com/threads/hey-proxmox-community-lets-talk-about-resources-isolation.124256/
###################################
# Do not modify these variables (set by Proxmox when calling the script)
vmId="$1"
@0xjac
0xjac / private_fork.md
Last active March 29, 2024 02:23
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@fabiolimace
fabiolimace / UUIDv6.sql
Last active March 29, 2024 02:23
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@wdolek
wdolek / ConsoleApp153.csproj
Created March 27, 2024 08:42
Proof that AutoMapper can be slower than your own manually written code
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@caercam
caercam / functions.php
Created June 22, 2016 07:06
Add 'MKV' and 'MP4' to supported WPMovieLibrary media types
<?php
/**
* Add new movie medias
*
* @param array Exisiting media
*
* @return array Updated media
*/
function wpmoly_add_new_media_type( $media ) {