Skip to content

Instantly share code, notes, and snippets.

View Alexhuszagh's full-sized avatar

Alexander Huszagh Alexhuszagh

View GitHub Profile
@Alexhuszagh
Alexhuszagh / .vimrc
Created August 5, 2015 01:13
Vim RC
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"
@Alexhuszagh
Alexhuszagh / Keybase.md
Created June 1, 2016 01:31
Keybase Declaration

Keybase proof

I hereby claim:

  • I am Alexhuszagh on github.
  • I am ahuszagh (https://keybase.io/ahuszagh) on keybase.
  • I have a public key whose fingerprint is E6B0 8BD5 B0A1 253A 5AA3 98E8 6592 5CF4 7A6D 8A24

To claim this, I am signing this object:

@Alexhuszagh
Alexhuszagh / shared_memory.py
Last active June 5, 2016 12:35
Shared Memory Access Numpy
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'''
Demo for accessing a read-only shared array for high-performance
numpy workloads.
@Alexhuszagh
Alexhuszagh / md5.py
Last active June 18, 2016 20:44
Sampled MD5 Example
#!/usr/bin/env python
'''
Calculate an MD5sum from the file, sampling ``read`` bytes within the file from every ``interval``.
'''
import hashlib
PATH = 'path/to/file'
@Alexhuszagh
Alexhuszagh / generator.cpp
Last active June 24, 2016 20:38
Generator Function Example
/**
* @brief Sample coroutine function which uses recursion for it's
* evaluation.
*
* @copyright 2016, Alex Huszagh
* @license MIT
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@Alexhuszagh
Alexhuszagh / endian.hpp
Last active May 15, 2022 06:48
Cross-Platform Solution to Determine System Byte-Order
// :copyright: (c) 2014-2016 Mathias Panzenböck
// :license: Public Domain/MIT, see licenses/MIT.txt for more details.
// :modified: Alex Huszagh, 2016. Added Windows-specific pre-processor definitions and byte-swap algorithms.
/** Endian utilties for determining and swapping byte order in
* applications.
*/
#include <algorithm>
#pragma once
@Alexhuszagh
Alexhuszagh / embed_file.py
Created August 5, 2016 15:01 — forked from jlisee/embed_file.py
Convert a file to a C file to embedding in a C/C++ program
#! /usr/bin/env python
# Copyright (c) 2014, Joseph Lisee
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
@Alexhuszagh
Alexhuszagh / align_matrix.py
Created September 5, 2016 00:22
Align Matrix
'''
align_matrix
------------
Aligns two sturctures and prints the distance matrix (complete)
between the two aligned matrices.
:author: Alex Huszagh
:license: Unlicense, or MIT
'''
@Alexhuszagh
Alexhuszagh / Encoding.md
Created September 15, 2016 05:42
Characterset-Conversion Stream Buffer Wrapper

Encoding

This file contains a stream-buffer wrapper automatically converting charactersets from a one encoding to a another. If the source and the destination encodings are the same, it calls memmove to move the bytes from the source to the destination.

Dependencies

Installation

@Alexhuszagh
Alexhuszagh / samsung_to_silence.py
Last active October 4, 2016 19:29
Samsung to Silence SMS
#!/usr/bin/env python
'''
samsung_to_silence.py
---------------------
Convert Samsung SMS plaintext backups (XML) to the silence format.
:warning: This has only been tested with the Samsung Galaxy S6, other
systems may differ.