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
template<class _InIt, class _Ty, class _Fn1> inline | |
void find_iterate(_InIt _First, _InIt _Last, const _Ty& _Val, _Fn1 _Func) | |
{ // find and perform a function if equals to _Val | |
for (_First = std::find(_First, _Last, _Val); _First != _Last; _First = std::find(++_First, _Last, _Val)) | |
_Func(*_First); | |
} | |
template<class _InIt, class _Pr, class _Fn1> inline | |
void find_if_iterate(_InIt _First, _InIt _Last, _Pr _Pred, _Fn1 _Func) | |
{ // find and perform a function satisfying _Pred |
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
import os | |
import itertools as it | |
import numpy as np | |
import cv2 | |
## Args | |
FilePath = 'gui.png' | |
OutImageFolder = 'Sprites' | |
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
// ==UserScript== | |
// @name TW Farm+ | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Vinícius Tabille Manjabosco | |
// @require https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js | |
// @match https://*.tribalwars.com.br/game.php?*screen=am_farm | |
// @grant none | |
// ==/UserScript== |
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 | |
# Workspace switcher for GNOME | |
# Author: thevtm@github | |
# | |
# Based on Andy Balaam's workspace-switcher | |
# http://www.artificialworlds.net/blog/2011/03/04/switching-workspace-in-gnome-via-the-command-line/ | |
# | |
# REQUIREMENTS: | |
# * wmctrl | |
# |
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
//- Pagination mixin | |
//- ---------------- | |
//- numPages = # links to serve up | |
//- numButtons = # of "side" buttons that will be present. | |
//- 2 numButtons will result in | << | 1 | 2 |>3<| 4 | 5 | >> | | |
//- curr = current page | |
//- base = base url before num | |
//- start at page 1 | |
//- | |
//- Example: |
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
'use strict' | |
/* | |
Modules | |
*/ | |
var Benchmark = require('benchmark') | |
var ms = require('ms') | |
var msNew = require('ms-new') |
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
/* | |
* Orginial: | |
* Quick and dirty tricks for debugging Javascript by Chang Wang | |
* https://hackernoon.com/quick-and-dirty-tricks-for-debugging-javascript-d0e911c3afa | |
* | |
* Translated to Typescript by @TheVTM | |
*/ | |
function print<T>(tag: string, param: T): T { | |
console.log(tag, param); |
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
Benchmarking 6 regexes for 18 test cases | |
Benchmarking test case: "17697971165612536521198392175651265616253619638124 minutes" | |
original x 4,228,677 ops/sec ±1.47% (86 runs sampled) | |
prototype0 x 4,329,400 ops/sec ±2.68% (81 runs sampled) | |
prototype1 x 4,015,480 ops/sec ±2.31% (83 runs sampled) | |
prototype2 x 4,621,512 ops/sec ±1.20% (88 runs sampled) | |
prototype3 x 4,516,519 ops/sec ±0.75% (90 runs sampled) | |
***totype4 x 4,729,367 ops/sec ±1.01% (88 runs sampled) |
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
/*** | |
* __ ______ ________________ ________ ___ _____ __ ___________ ____ ____ _____ | |
* / |/ / | / ____/ _/ ____/ / ____/ / / | / ___// / / / ____/ | / __ \/ __ \/ ___/ | |
* / /|_/ / /| |/ / __ / // / / /_ / / / /| | \__ \/ /_/ / / / /| | / /_/ / / / /\__ \ | |
* / / / / ___ / /_/ // // /___ / __/ / /___/ ___ |___/ / __ / /___/ ___ |/ _, _/ /_/ /___/ / | |
* /_/ /_/_/ |_\____/___/\____/ /_/ /_____/_/ |_/____/_/ /_/\____/_/ |_/_/ |_/_____//____/ | |
* | |
*/ | |
(function() { |
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
# https://github.com/alacritty/alacritty | |
# https://github.com/dancor/wmctrl | |
# https://github.com/baskerville/sxhkd | |
# https://github.com/noctuid/tdrop | |
super + z | |
tdrop -n top --width 100% --height 30% --post-map-hook 'wmctrl -r "Alacritty - Drop Down - Top" -b add,above,sticky' alacritty --title 'Alacritty - Drop Down - Top' | |
super + shift + z | |
tdrop -n bottom -y 64% --width 100% --height 30% --post-map-hook 'wmctrl -r "Alacritty - Drop Down - Bottom" -b add,above,sticky' alacritty --title 'Alacritty - Drop Down - Bottom' |
OlderNewer