Skip to content

Instantly share code, notes, and snippets.

Russ Gray russgray

Block or report user

Report or block russgray

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
@russgray
russgray / MC Cheat Sheet
Created Apr 5, 2019 — forked from urnenfeld/MC Cheat Sheet
Midnight Commander Cheat Sheet
View MC Cheat Sheet
Shortcut Description
---------------------------------------------------------------
C-o Drop to the console
Insert Select/deselect file
* Invert selection on files
+ Specify file selection options (including custom pattern)
- The same as above, but for deselecting
F5/F6 Copy/move selected files
@russgray
russgray / marshal-variable-length-array.cs
Created Sep 29, 2014
Marshalling a variable-length array from unmanaged code in C#
View marshal-variable-length-array.cs
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace DnsMarshallingTest
{
#region Data structures
[Flags]
internal enum DnsRecordType : ushort
View subscript.py
"""Subscript extension for Markdown.
To subscript something, place a tilde symbol, '~', before and after the
text that you would like in subscript: C~6~H~12~O~6~
The numbers in this example will be subscripted. See below for more:
Examples:
>>> import markdown
>>> md = markdown.Markdown(extensions=['subscript'])
@russgray
russgray / AES.java
Last active Sep 8, 2015 — forked from dweymouth/AES.java
A Java class to perform password-based AES encryption and decryption
View AES.java
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <dweymouth@gmail.com> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. D. Weymouth 4/2014
* ----------------------------------------------------------------------------
*/
import java.io.*;
@russgray
russgray / sms_trace
Last active Sep 1, 2015 — forked from henrikw/sms_trace
An example of a session-based log (the sending of an SMS)
View sms_trace
Type: Trace
Time stamp: 2014-01-20 09:23:01.910 CET
Trace key: 46702000029
Source: pf-Cluster=tsmr,pf-Host=tsmr1,pf-Node=tsmr1,map-Layer=map@tsmr1
Trace:
-- 0, platform: Context info: StructuredDialogue
Origination address : {SccpUserAddress: RoutingIndicator=ROUTE_ON_GT, SignallingPointCode=null, SubsystemNumber=8, GlobalTitle={GlobalTitle: GtIndicator=INDICATOR_0100, TranslationType=0, {QualifiedDigits: NumberPlan=MSISDN, NumberType=INTERNATIONAL, Digits=461000301}}}
Destination address : {SccpUserAddress: RoutingIndicator=ROUTE_ON_GT, SignallingPointCode=null, SubsystemNumber=8, GlobalTitle={GlobalTitle: GtIndicator=INDICATOR_0100, TranslationType=0, {QualifiedDigits: NumberPlan=MSISDN, NumberType=INTERNATIONAL, Digits=461000101}}}
TC-BEGIN ind
View RollbarAppenderFactory.java
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.Layout;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.tapstream.rollbar.RollbarAppender;
import io.dropwizard.logging.AbstractAppenderFactory;
import javax.validation.constraints.NotNull;
@russgray
russgray / TweakedCoverage.xml
Created Oct 1, 2014
Reporting on NCover Exclusions
View TweakedCoverage.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href='CoverageReport.xsl' type='text/xsl'?>
<!-- Generated by NCoverExplorer url=http://www.kiwidude.com/blog/ -->
<coverageReport reportTitle="Module Class Summary" date="Fri 15-Jun-2007" time="10:49:14" version="1.3.6.32">
<project name="Atmosphere Processor::LV426" files="31" classes="34" members="541" nonCommentLines="4450" sequencePoints="4460" unvisitedPoints="1321" unvisitedFunctions="152" coverage="70.3811646" acceptable="80" functionCoverage="71.9038849" acceptableFunction="80" filteredBy="None" sortedBy="Name">
<coverageFiles>
<coverageFile>C:\Program Files\NAnt\0.85\bin\Coverage.xml</coverageFile>
</coverageFiles>
</project>
<modules>
View gist:99e8feaf3e471a04d2bc
var rawSites = {
'programming': [
'http://blog.codinghorror.com/',
'http://thedailywtf.com/',
'http://www.hanselman.com/blog/',
'http://code.tutsplus.com',
'https://news.ycombinator.com/',
'http://www.reddit.com/r/programming/',
'http://codebetter.com',
'http://android-developers.blogspot.com/',
View mysql2sqlite.sh
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
View gist:3d3cbdda7de79b4c7c1b
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Start">
<Import Project="lib\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<!-- Variables -->
<PropertyGroup>
<!-- Release Folder -->
<!-- To change the output folder, use the following parameter: /p:BuildDir=C:\BuildTest-->
You can’t perform that action at this time.