This file contains 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 main | |
import ( | |
"fmt" | |
"bufio" | |
"os" | |
) | |
//see Cracking Code Interview | |
//practice merge sort (recursive; next try iterative...) | |
//input is n items on line 1, then space separated values on line 2 |
This file contains 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 main | |
import ( | |
"fmt" | |
"bufio" | |
"os" | |
) | |
//see Cracking Code Interview | |
//practice quick sort (recursive) |
This file contains 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 main | |
import ( | |
"fmt" | |
"bufio" | |
"os" | |
"errors" | |
) | |
//practice LRU cache |
This file contains 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
-- Original script is on Spotify Applescript API page | |
-- Creates a notification with information about the currently playing track | |
-- Main flow | |
set theFile to (((path to desktop folder) as string) & "trackinfo.txt") | |
if appIsRunning("Spotify") then | |
set currentlyPlayingTrack to getCurrentlyPlayingTrack() | |
----displayTrackName(currentlyPlayingTrack) | |
writeTextToFile(currentlyPlayingTrack, theFile, true) | |
This file contains 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
#lru.py | |
#loop input until 'EXIT' | |
read_line = "" | |
data = [] | |
while read_line.lower() != "exit": | |
read_line = raw_input() | |
if read_line.lower() != "exit": | |
data.append(read_line) |
This file contains 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
Reference https://msdn.microsoft.com/en-us/library/orm-9780596527730-01-04.aspx | |
Attempt of the pluggable adapter according to this excerpt: | |
// Existing way requests are implemented | |
class Adaptee { | |
public double Precise (double a, double b) { | |
return a/b; | |
} | |
} |
This file contains 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 main | |
import ( | |
"crypto/sha1" | |
"crypto/sha256" | |
"fmt" | |
) | |
// Adaptee is the existing functionality. | |
type Adaptee struct { |
This file contains 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
#!/bin/sh | |
ffmpeg -ss 00:00:00.000 -i Source.mp3 -t 44 -c copy cut00.mp4 |
This file contains 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
#!/bin/bash | |
INFILE="$1" | |
TMPOUTFILE="${INFILE%.*}" | |
OUTFILE="${TMPOUTFILE##*/}.m4a" | |
ffmpeg -i "${INFILE}" -vn -acodec copy "${OUTFILE}" |
This file contains 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
#!/bin/bash | |
#brew install youtube-dl | |
#brew install ffmpeg | |
youtube-dl --extract-audio --audio-format mp3 -k https://youtu.be/short-url-path |
OlderNewer