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 | |
# To use, put in the file: | |
# /etc/libvirt/hooks/qemu | |
# remember to chmod +x | |
echo $1 $2 | |
cores=$(grep -c ^processor /proc/cpuinfo) | |
last_core=$((cores-1)) | |
host_cpuset="0-$last_core" |
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
#include <type_traits> | |
#define DECLARE_HASA(what) \ | |
template<typename T, typename = int> struct has_##what : std::false_type { };\ | |
template<typename T> struct has_##what<T, decltype((void) T::what, 0)> : std::true_type {}; | |
DECLARE_HASA(when) //declares above statement with 'when' replacing 'what' |
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
Canada | Pandemic | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Total | Recovered | death recordings | dead% | recovered% | BC.total | BC.Recovered | % | NB.total | NB.Recovered | % | NS.total | NS.Recovered | % | ||||
04-14 | |||||||||||||||||
04-13 | 25680 | 7756 | 780 | 3.0% | 30.2% | 1490 | 926 | 62.1% | 116 | 74 | 63.8% | 473 | 101 | 21.4% | |||
04-12 | 24384 | 7170 | 0.0% | 29.4% | 1470 | 905 | 61.6% | 114 | 70 | 61.4% | 445 | 97 | 21.8% | ||||
04-11 | 23318 | 6013 | 653 | 2.8% | 25.8% | 1445 | 905 | 62.6% | 112 | 70 | 62.5% | 428 | 95 | 22.2% | |||
04-10 | Second 14 days | 22148 | 6013 | 0.0% | 27.1% | 1410 | 879 | 62.3% | 112 | 60 | 53.6% | 407 | 93 | 22.9% | |||
04-09 | 20765 | 5311 | 509 | 2.5% | 25.6% | 1370 | 858 | 62.6% | 111 | 53 | 47.7% | 373 | 82 | 22.0% | |||
04-08 | 19291 | 4653 | 435 | 2.3% | 24.1% | 1336 | 838 | 62.7% | 108 | 50 | 46.3% | 342 | 77 | 22.5% | |||
04-07 | 17883 | 4050 | 381 | 2.1% | 22.6% | 1291 | 805 | 62.4% | 105 | 39 | 37.1% | 310 | 66 | 21.3% |
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
static void DepthFirstProcNodes(JTMetaNode* jt_node, std::function<void(JTMetaNode*)> procedure){ | |
/** Process by depth first | |
* 1. loop over all edges in this node | |
* 2. for every edge to a child (ie. edge.Right != bn_node) | |
* - put this child node on the top of the stack | |
* - go back to step 1 for the node from the top of the stack | |
* 3. run the provided procedure on the node | |
* 4. unwind stack and continue at step 2 for the node on the stack*/ | |
for(auto jt_iter = jt_node->Edges.begin(); jt_iter != jt_node->Edges.end(); ++jt_iter) { | |
if(jt_node != jt_iter->Right) { |
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
#!/usr/bin/bash | |
if [ -z "$lastCMD" ]; then | |
if [ -z "$SHELLSTARTED" ]; then | |
export SHELLSTARTED="1"; | |
else | |
echo -e "purgehistory_core: Error 1: \$lastCMD is empty"; | |
fi | |
exit 1 | |
elif [ ! -z "$HISTPURGEFAIL" ]; then | |
exit 2 |
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
-- Query is a script useful for finding and reading values of data structure fields. Purposes will likely be exclusive to writing lua script code. | |
-- Written by Josh Cooper(cppcooper) on 2017-12-21, last modified: 2020-03-08 | |
-- Version: 2.x | |
local utils=require('utils') | |
local validArgs = utils.invert({ | |
'help', | |
'unit', | |
'item', | |
'tile', |
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
struct delimiter_ctype : std::ctype<char> { | |
static const mask* make_table(std::string delims) { | |
// make a copy of the "C" locale table | |
static std::vector<mask> v(classic_table(), classic_table() + table_size); | |
for(mask m : v) { | |
m &= ~space; | |
} | |
for(char d : delims) { | |
v[d] |= space; | |
} |
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
#!/usr/bin/bash | |
windows() { [[ -n "$WINDIR" ]]; } | |
if ! windows; then | |
lock="/tmp/.lock-sshbash" | |
exec 3>$lock | |
flock --timeout 300 3 || exit 1 | |
fi | |
get-agents() { |
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
#include <filesystem> | |
#include <iostream> | |
#include <regex> | |
#include <vector> | |
#include <fstream> | |
#include <sstream> | |
#pragma warning (disable : 4267) | |
namespace fs = std::filesystem; | |
void print_data(const std::vector<std::string> &lines) { |
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 Netflix Shuffle | |
// @version 1.2 | |
// @author Cooper | |
// @description an ok netflix shuffler | |
// @match https://www.netflix.com/browse/my-list | |
// @namespace github.com/cppcooper | |
// @grant none | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js | |
// ==/UserScript== |
NewerOlder