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
/** | |
* @param {string} s | |
* @return {string} | |
*/ | |
var longestPalindrome = function(s) { | |
const emptyArr = s.split('').fill(0) | |
var [unevenMap, evenMap] = [[...emptyArr], [...emptyArr]] | |
const increaseUneven = (index, level) => { | |
// hack cos NaN === NaN is false |
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
document.getElementsByTagName("pre")[0].innerText.split(/\n/).reduce((c,n) => (+c)+ (+n), 0) |
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
#!bin/bash | |
# navigate to Steam | |
cd ~/Library/Application\ Support/Steam/steamapps | |
# allow Morrowind from macOS | |
cat <<EOT >> appmanifest_22320.acf | |
"AppState" | |
{ | |
"AppID" "22320" |
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
#!/bin/sh | |
# | |
# Usage: ./redis-delkeys.sh [-h host] [-p port] [-n db] "pattern" | |
# | |
# Matches keys with the KEYS command matching pattern | |
# and deletes them from the specified Redis DB. | |
set -e | |
HOST="localhost" |
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
<pre ng-init="showPre=true" ng-show="showPre">{{ debugData | json}}</pre> | |
<a href ng-click = "showPre = !showPre">{{showPre? 'Hide' : 'Show'}} debug data</a> |
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
$scope.runSpritz = function () { | |
if ($scope.spritzIsActivated) return; | |
var spritzController = null; | |
var onSpritzifySuccess = function (spritzText) { | |
spritzController.startSpritzing(spritzText); | |
}; | |
var onSpritzifyError = function (error) { |