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 | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
| ATV="$DIR/atv" | |
| ATV_URL="$DIR/atv-airplay-url" | |
| TMP_DIR="/tmp/play-$RANDOM" | |
| HTTP_SERVER="/usr/local/bin/http-server" | |
| NPM="/usr/local/bin/npm" | |
| if [[ ! -f "$1" ]]; then |
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
| javascript:void(function(){function e(e){let i="",o="",t="";return e>3600&&(e-=3600*(i=Math.floor(e/3600)),i=`${i} hrs`),e>60&&(e-=60*(o=Math.floor(e/60)),o=`${o} min`),e&&(t=`${e} sec`),[i,o,t].join(" ").trim()}function i(){window.__close_timer.timer&&window.clearInterval(window.__close_timer.timer),window.__close_timer.timer="",window.__close_timer.active=!1,window.__close_timer.sec=0,window.__close_timer.title=""}if(void 0===window.__close_timer&&(window.__close_timer={}),window.__close_timer.active){let o=e(window.__close_timer.sec);return window.confirm(`%E2%8F%B2 :${o}\n%F0%9F%9A%AB%E2%8F%B2?`)?(document.title=window.__close_timer.title,void i()):void 0}let o="10m",t=document.querySelector("video");if(t){o=e(Math.floor(t.duration-t.currentTime)+5)}let _=window.prompt("%E2%8F%B2%F0%9F%92%A4 %E2%86%92%E2%9D%8C",o).trim();if(!_)return;let r=_.toLowerCase().match(/^(([0-9\.]+)\s*(hours|hour|hrs|hr|h))?\s*(([0-9\.]+)\s*(minute|minute|mins|min|m))?\s*(([0-9\.]+)\s*(seconds|second|secs|sec|s))?$/),n=0;r[2]&&(n |
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
| void(function(){ | |
| function sec2time_str(sec) { | |
| let h=''; | |
| let m=''; | |
| let s=''; | |
| if (sec > 3600) { | |
| h = Math.floor(sec / 3600); | |
| sec -= 3600*h; | |
| h = `${h} hrs`; | |
| } |
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
| // ==UserScript== | |
| // @name cocoa hide twitter annoying "Liked by XX" and "Promoted tweets" | |
| // @namespace cocoabox.twitter.hide_promoted | |
| // @description cocoa hide twitter annoying "Liked by XX" and "Promoted tweets | |
| // @include https://twitter.com/* | |
| // @version 1.0.0 | |
| // @run-at document-start | |
| // @grant none | |
| // ==/UserScript== | |
| (function(){ |
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
| ( function () { | |
| let words = 'player vid'; | |
| words = window.prompt('block what?',words); | |
| words = words.split(' ').map(n=>n.trim()); | |
| if (typeof window.__fuckTimer__ !== 'undefined') return; | |
| const del = function(node) { | |
| if (!node) return; | |
| node.parentNode.removeChild(node); |
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
| javascript:(function(document){ function init() { if (! document.__has_yellowfade__) { let node = document.createElement('style'); node.innerHTML = ` @keyframes yellowfade { from { background: yellow; } to { background: transparent; } } .yellowfade-box { animation-name: yellowfade; animation-duration: 2s; }`; document.body.appendChild(node); document.__has_yellowfade__ = true; } } function hilite(selector, want_focus) { let elem = document.querySelector(selector); if (! elem) return; if (want_focus) { elem.scrollIntoView(); } elem.classList.add('yellowfade-box'); setTimeout(function(){ elem.classList.remove('yellowfade-box'); }, 2000); } init(); hilite('#offers', true); hilite('#rakutenLimitedId_aroundCart');})(window.document); |
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
| /* | |
| --input.txt-- | |
| 13 5 5 | |
| 900 600 700 600 2000 2300 1600 500 2800 1500 1900 2200 2500 | |
| --EOF-- | |
| */ | |
| process.stdin.resume(); | |
| process.stdin.setEncoding('utf8'); | |
| const LOG=true; | |
| var stdin = ''; |
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
| <?php | |
| // | |
| // approach | |
| // for any array A0, A1,.. Ai-1, Ai, Ai+1, ... An | |
| // | |
| // to find max sum up to Ai, life is very easy if we already know | |
| // max sum up to A[i-1], in particular, max sum up to Ai is : | |
| // | |
| // bigger value among ( | |
| // MaxSum(A0,A1,..An-1) + Ai, // continue adding Ai to the current sum |
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
| <?php | |
| class Range { | |
| public $begin; | |
| public $end; | |
| function __construct($begin, $end) { | |
| $this->begin = $begin; | |
| $this->end = $end; | |
| } | |
| function __toString() { |
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
| # .bashrc | |
| # ======= | |
| to-mp4-baseline () | |
| { | |
| if [ -z "$2" ]; then | |
| OUT="$1.mp4"; | |
| else | |
| OUT="$2"; | |
| fi; | |
| if [ -f "$OUT" ]; then |