Skip to content

Instantly share code, notes, and snippets.

@rm-code
rm-code / ArrayRotation.lua
Last active August 21, 2022 10:04
Helper module which allows the rotation of square and non square arrays.
--==================================================================================
-- Copyright (C) 2017 by Robert Machmer =
-- =
-- 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 =
-- furnished to do so, subject to the following conditions: =
-- =
@rm-code
rm-code / dropzone-test.markdown
Last active July 12, 2019 10:37
Dropzone Test
@rm-code
rm-code / style.less
Created May 11, 2015 12:49
Custom tab style for Atom's zen package
@import "ui-variables";
@import "syntax-variables";
// Make zen tabs more zen-like
[data-zen="true"] {
atom-pane-container atom-pane .item-views {
background: @syntax-background-color !important;
}
atom-text-editor:not(.mini) {
margin: 0 auto;
@rm-code
rm-code / TableDump.lua
Last active March 18, 2017 01:19
Debug function which dumps a table with a pretty structure.
local function serialize( value, output, depth )
local ws = ' ';
for _ = 1, depth do
ws = ws .. ' ';
end
if type( value ) == 'table' then
for k, v in pairs(value) do
if type( v ) == 'table' then
table.insert( output, string.format( '%s[\'%s\'] = {', ws, tostring( k )));
serialize( v, output, depth + 1 );
@rm-code
rm-code / count_loc.sh
Last active January 15, 2017 04:19
Bash one-liners to count lines of code.
# Only returns the total lines of code.
# Remove the tail call to show a more verbose output.
wc -l $(find . -name '*.lua') | tail -1
# Add more files as parameters.
wc -l $(find . -name '*.lua' -or -name '*.sh' ) | tail -1
# This would return the lines of code of all .lua files in your repository.
# Simply exchange .lua with the extension you want to search for.
wc -l $(git ls-files | grep -e '.*\.lua' )
@rm-code
rm-code / removeDS_Store
Last active August 29, 2015 14:19
Recursively delete DS_Store files on OSX
find . -name *.DS_Store -type f -delete