Skip to content

Instantly share code, notes, and snippets.

Matt Borja rdev5

Block or report user

Report or block rdev5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View UserAccountFlags.cs
/// <summary>
/// Defines the flags used for setting user properties in the directory.
/// </summary>
/// <remarks>
/// Source: https://msdn.microsoft.com/en-us/library/ms180913(v=vs.80).aspx
/// </remarks>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public static class UserAccountFlags
{
public const int ADS_UF_SCRIPT = 1; // 0x1
View UserAccountFlags.cs
/// <summary>
/// Defines the flags used for setting user properties in the directory.
/// </summary>
/// <remarks>
/// Source: https://msdn.microsoft.com/en-us/library/ms180913(v=vs.80).aspx
/// </remarks>
[SuppressMessage("ReSharper", "InconsistentNaming")]
public static class UserAccountFlags
{
public const int ADS_UF_SCRIPT = 1; // 0x1
View to-grid-or-not-to-grid.html
<div class="container">
<!-- Don't need grid system here... -->
<div class="page-header">
<h1>Request</h1>
</div>
<!-- ...or here -->
<div class="well well-lg">
<strong>Status: Revoked</strong>
</div>
View createForm.js
var createForm = function(action, fields) {
function isObject(val) {
if (val === null) { return false;}
return ( (typeof val === 'function') || (typeof val === 'object') );
}
if (!isObject(fields))
return;
// Create form
View iis-usermode-output-caching.web.config.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!--
Configuration Summary:
- Use faster kernel-mode caching for static assets (i.e. images, scripts, stylesheets, HTML), only refreshing them if the file itself changes.
- Use user-mode caching (varyByHeaders), expiring after 5 minutes (default cache worthiness: 2 hits within 10s)
-->
<caching enabled="true" enableKernelCache="true">
<profiles>
View backup-database.sh
#!/bin/bash
host="$1"
user="$2"
database="$3"
output="$4"
if [ -z "$host" ] || [ -z "$user" ] || [ -z "$database" ] || [ -z "$output" ]; then
echo "Usage: $0 <host> <user> <database> <outputfile>"
exit
fi
@rdev5
rdev5 / AESGCM.cs
Created May 25, 2016 — forked from jbtule/AESGCM.cs
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
View AESGCM.cs
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;
View tesla-master-key.txt
440a241dd80fcc5664e861989db716e08ce627d8d40c7ea360ae855c727a49ee
View clearChromeHistorySelectively.js
/*
* Usage:
* document.location = 'chrome://history-frame/';
* clearResults('Gmail'); // rinse and repeat
*/
var purgeResults=function(){document.getElementById("remove-selected").disabled=!1;for(var e=document.getElementsByTagName("input"),t=0;t<e.length;++t)"checkbox"==e[t].type&&(e[t].checked=!0);document.getElementById("remove-selected").disabled=!1,document.getElementById("remove-selected").click(),document.getElementById("alertOverlayOk").click()};
var clearResults=function(e){document.getElementById("search-field").value=e,document.getElementById("search-button").click(); setTimeout(function() { purgeResults(); }, 1000);};
@rdev5
rdev5 / 0_reuse_code.js
Created Apr 15, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.