This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package heaps | |
// Elem is a comparable element of the heap | |
type Elem interface { | |
Compare(elem Elem) int | |
} | |
// PairingHeap is a type of heap data structure | |
type PairingHeap struct { | |
elem Elem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sets | |
import ( | |
"fmt" | |
"strings" | |
) | |
// DisjointSet tracks a set of elements partitioned | |
// into a number of disjoint (non-overlapping) subsets. | |
type DisjointSet struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30; do find . -type f -name "${i}*" -print ; done > /tmp/files | |
cat /tmp/files | while read line || [[ -n $line ]]; do d=`dirname "${line}"`; b1=`basename "${line}"`; b2=`basename "${line}" | cut -c4-`; mv "${d}/${b1}" "${d}/${b2}"; done | |
find . -type f -name "*.m4a" -exec ffmpeg -v 5 -y -i '{}' -acodec libmp3lame -ac 2 -ab 192k '{}'.mp3 \; -print |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <iostream> | |
#include <memory> | |
#include <stdexcept> | |
#include <string> | |
#include <array> | |
std::string exec(const char* cmd) { | |
std::array<char, 128> buffer; | |
std::string result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
do shell script "hidutil property --set '{\"UserKeyMapping\":[{\"HIDKeyboardModifierMappingSrc\":0x700000064,\"HIDKeyboardModifierMappingDst\":0x700000035}]}'" with administrator privileges | |
return input | |
end run |
OlderNewer