Skip to content

Instantly share code, notes, and snippets.

the-nose-knows

Block or report user

Report or block the-nose-knows

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 qregularexpression_example_app.cpp
#include <QCoreApplication>
#include <QRegularExpressionMatch>
#include <QStringList>
#include <iostream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QStringList results;
QRegularExpression this_regex("(\\wog)|(\\wee)");
View ruby_nested_hash_example.rb
# Ruby - A nested hash example
# Load each pair of args on the command-line as a key-value pair
# For example from CMD.exe:
# call ruby.exe ruby_nested_hash_example.rb Age 30 Name Mary Fav_Hobby Ataraxia Fav_Number 42
# Output would be:
# {
# "data_info": {
# "types": {
# "nums": {
# "Age": 30,
View ruby_multi_dimensional_array.rb
# Original class developed by dbjsy of StackOverflow
# User_URL: http://stackoverflow.com/users/4293919/dbjsy
# Question_URL: http://stackoverflow.com/questions/7014052/ruby-multidimensional-array
# Answer_URL: http://stackoverflow.com/a/35429385/3543437
#
# Produces a PHP/Classic-style multidimensional array.
#
# Example:
# arr = MArray.new
# arr[1][2][3] = "foo"
View js_object_iteration_with_map.js
/*
* Derived from an answer at StackOverflow
* Answer: http://stackoverflow.com/a/40737306/3543437
* Question: http://stackoverflow.com/questions/8312459/iterate-through-object-properties
* Answer Author: http://stackoverflow.com/users/1073330/frank-roth
* Purpose: Illustrate how the single-liner can be split up into multiple lines using map((key)=>(value))
*/
Object
.keys(mock_json_complex)
View js_empty_obj_val_check.js
var empty_obj = {};
if(Object.entries(empty_obj)==undefined)
{
console.log('is undefined');
}
else if(Object.entries(empty_obj)==null)
{
console.log('is null');
}
else if(Object.entries(empty_obj)=={})
View dotnet_inspector_gadget.cs
using System;
using System.Reflection;
using System.IO;
namespace DotNetInspectorGadget
{
class DotNetInspectorGadget
{
static int Main(string[] args)
{
if(args.GetLength(0) < 1)
View load_library_ex_experiment.cs
// Answer is a slight diff of Ed Bayiate's answer on Stack Overflow
// Answer URI: http://stackoverflow.com/a/6903367/3543437
// Question URI: http://stackoverflow.com/questions/6903256/how-to-programmatically-check-c-dll-files-and-c-sharp-dll-files-for-references
// Answer Author Profile URI: http://stackoverflow.com/users/695833/ed-bayiates
using System;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
View getDependencyListOfDlls.cpp
/*
* Get Dependency List of DLLs
* Lists names of DLLs used to build the binary
* CAVEAT 1: Will not tell you what DLLs are loaded into the module at runtime
* CAVEAT 2: Will not tell you .NET Assembly Information
* CAVEAT 3: This app seems to crash on 64-bit applications; not sure why, exactly. Even occurs on itself when compiled as x86_amd64.
*
* I take no credit for this. It was wholly derived from a forum post of the C Boards. This is my hacked diff to only get DLL names.
*
* Forum Post Internet Archive Snapshot: http://web.archive.org/web/20090327115720/http://cboard.cprogramming.com:80/windows-programming/82906-problem-while-reading-inport-table.html
View load_pe_var_dump.txt
+ addy 0x000000a578d2f3a8 {0x0000000000001000} unsigned __int64 *
argc 0x00000002 int
+ argv 0x0000029771432410 {0x0000029771432428 "C:\\Users\\TheUser\\documents\\visual studio 2017\\Projects\\load_pe\\x64\\Debug\\load_pe.exe"} char * *
coverted_base_address 0x0000029771370000 unsigned __int64
data_directory_optional_header_offset 0x0000000000000070 unsigned __int64
direct_access_size_stack 0x0000000000001000 unsigned __int64
error_check 0x00000000 int
+ filesystem_image {_Mystr=L"C:\\pathToFile\\some_test.exe" } std::experimental::filesystem::v1::path
+ image_directory "C:\\pathToFile" std::basic_string<char,std::char_traits<char>,std::allocator<char> >
image_loaded true bool
View loadpe_allvars_dump.txt
+ addy 0x0000004032f4e238 {0x0000000000001000} unsigned __int64 *
argc 0x00000002 int
+ argv 0x000001560ce43920 {0x000001560ce43938 "C:\\Users\\TheUser\\documents\\visual studio 2017\\Projects\\load_pe\\x64\\Debug\\load_pe.exe"} char * *
Characteristics 0x00000022 unsigned long
coverted_base_address 0x000001560cd90000 unsigned __int64
data_directory_optional_header_offset 0x0000000000000070 unsigned __int64
direct_access_size_stack 0x0000000000001000 unsigned __int64
error_check 0x00000000 int
fDOSImage 0x00 '\0' unsigned char
+ FileHeader 0x000001560cd90100 {Signature=0x00004550 FileHeader={Machine=0x8664 NumberOfSections=0x0008 TimeDateStamp=...} ...} _IMAGE_NT_HEADERS64 *
You can’t perform that action at this time.