Skip to content

Instantly share code, notes, and snippets.

View stephan-nordnes-eriksen's full-sized avatar
Coffee!

Stephan Nordnes Eriksen stephan-nordnes-eriksen

Coffee!
  • Norway
View GitHub Profile
gitk --all --first-parent --remotes --reflog --author-date-order -- local/path/to/file.extension
@stephan-nordnes-eriksen
stephan-nordnes-eriksen / ToWav.bat
Last active May 22, 2021 09:55
.bat script for drag-n-dropping audio files to convert them into .wav with ffmpeg. Assumes globally available ffmpeg command
if [%1]==[] goto :eof
:loop
@echo converting %1 to .wav
ffmpeg -i %1 "%~dpn1%.wav"
shift
if not [%1]==[] goto loop
echo Done
@pause
@stephan-nordnes-eriksen
stephan-nordnes-eriksen / miniTemplater.ts
Last active October 28, 2019 14:23
Mini Templater implemented in typescript
/**
* Parse Configuration for the MiniTemlater. This is essentially just a JavaScript object
*/
export interface ParseConfig {
[key: string]: string
}
/**
* MiniTemplater is a super-simple templating engine.
*
@stephan-nordnes-eriksen
stephan-nordnes-eriksen / countryAndLanguageFromIosOrAndroidLocale.js
Last active July 26, 2023 10:26
JavaScript/Node.js Get Country from iOS or Android locale string
/**
* Get the country code (ISO 3166-1 alpha-2) from a valid locale string from Android or iOS.
* Valid locale strings are described here:
* ios: https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html
* android: https://developer.android.com/reference/java/util/Locale.html
*
* Tested with ava.
*
* @param {*string} localeString The locale string from android or ios
*/
<html>
<body>
<h2>Privacy Policy</h2>
<p>Stephan Nordnes Eriksen Software Consulting built the Shake-Take app as a free app. This SERVICE is provided by Stephan Nordnes Eriksen Software Consulting at no cost and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding our policies with the collection, use, and
disclosure of Personal Information if anyone decided to use our Service.</p>
<p>If you choose to use our Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that we collect are used for providing and
improving the Service. We will not use or share your information with anyone except as described
@stephan-nordnes-eriksen
stephan-nordnes-eriksen / verbose.txt
Created September 5, 2015 12:00
Output from npm i leveldown --verbose
> leveldown@1.4.1 install H:\MEGA\Programming\ES\server\node_modules\leveldown
> prebuild --download
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 9/5/2015 1:43:57 PM.
Project "H:\MEGA\Programming\ES\server\node_modules\leveldown\build\binding.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|x64".
Project "H:\MEGA\Programming\ES\server\node_modules\leveldown\build\binding.sln" (1) is building "H:\MEGA\Programming\ES\server\node_modules\leveldown\deps\leveldb\leveldb.vcxproj" (2) on node 1 (default targets).
@stephan-nordnes-eriksen
stephan-nordnes-eriksen / npm-debug.log
Created September 5, 2015 08:50
npm-debug.log from running "npm install levelup leveldown"
This file has been truncated, but you can view the full file.
2001 silly gunzTarPerm extractEntry package.json
2002 silly gunzTarPerm modified mode [ 'package.json', 420, 438 ]
2003 silly gunzTarPerm extractEntry README.md
2004 silly gunzTarPerm modified mode [ 'README.md', 420, 438 ]
2005 silly gunzTarPerm extractEntry bindings.js
2006 silly gunzTarPerm modified mode [ 'bindings.js', 420, 438 ]
2007 silly gunzTarPerm extractEntry include_dirs.js
2008 silly gunzTarPerm modified mode [ 'include_dirs.js', 436, 438 ]
2009 silly gunzTarPerm extractEntry nan_converters.h
2010 silly gunzTarPerm modified mode [ 'nan_converters.h', 436, 438 ]
@stephan-nordnes-eriksen
stephan-nordnes-eriksen / key-value-performance-test.md
Last active February 21, 2024 03:22
Performance testing different Key-Value stores in Ruby

For a project I am on I need to use a key-value store to converts file-paths to fixnum IDs. The dataset will typically be in the range of 100 000 to 1 000 000. These tests use 305 000 file paths to fixnum IDs.

The Different Key-Value stores tested are:

Daybreak: "Daybreak is a simple and very fast key value store for ruby" GDBM: GNU dbm. "a simple database engine for storing key-value pairs on disk." DBM: "The DBM class provides a wrapper to a Unix-style dbm or Database Manager library" PStore: "PStore implements a file based persistence mechanism based on a Hash. "

Out of these, all except Daybreak are in the Ruby standard library.