Skip to content

Instantly share code, notes, and snippets.

@sklivvz
sklivvz / KillerSudoku.cs
Created October 20, 2022 11:25
Efficient killer/sandwich sudoku calculator in one line of c#
void Main()
{
var x = new List<int>{1,2,3,4,5,6,7,8,9};
Killer(x,6).Dump();
}
public static List<List<int>> Killer(List<int> alphabet, int target) =>
alphabet.Where(x=> x <= target).SelectMany(letter=>
(letter == target) ?
new List<List<int>> { new List<int> { letter }} :
@sklivvz
sklivvz / sheets.json
Created November 26, 2021 23:57
JSON object exported by the 'Sheets to JSON' Google Sheets addon.
{}
@sklivvz
sklivvz / talent_ids.json
Last active March 31, 2018 11:55
All WoW talent ids and names
[
{
"name": "A Murder of Crows",
"id": "131894"
},
{
"name": "A Murder of Crows",
"id": "206505"
},
{
// scrape talent ids from http://www.wowhead.com/talents
copy(Array.from(document.getElementsByClassName("listview-cleartext")).map((x)=>{return{name: x.innerText, id:x.getAttribute("href").split("=")[1]}}))
@sklivvz
sklivvz / talents.en-gb.json
Created March 31, 2018 09:59
All WoW talents in Json format (en-gb)
[
{
"class": "warrior",
"specs": [
{
"spec": "arms",
"talents": [
{
"name": "Dauntless",
"description": "Your abilities cost 10% less Rage."
// use in console on https://worldofwarcraft.com/en-gb/game/talent-calculator
Array.from(document.querySelectorAll('[data-group="TalentCalculator-class"]')).map((cls)=>{
return { class: cls.getAttribute("name"), specs: Array.from(cls.querySelectorAll('[data-group="TalentCalculator-specs"]')).map((spc)=>{
return { spec: spc.getAttribute("name").split("/")[1], talents: Array.from(spc.getElementsByClassName("Talent")).map((t)=>{
return { name: t.getElementsByClassName("Talent-name")[0].childNodes[0].nodeValue, description: t.getElementsByClassName("Talent-desc")[0].innerText };
})};
})};
});
@sklivvz
sklivvz / rover.il
Last active May 18, 2016 22:11
Solving the rover problem in IL
.assembly extern mscorlib {}
.assembly rover
{
.ver 1:0:1:0
}
// to compile, open visualstudio cmd, "ilasm rover.il"
.module rover.exe
.method static void main() cil managed
void Main()
{
var m = new int[] { 0, 1, 0, -1, 0 };
var inputs = @"5 5
1 2 N
LMLMLMLMM
3 3 E
MMRMMRMRRM".Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
for (int i = 1; i < inputs.Length; i += 2)
{

#What is community moderation, and why should I care?

Community moderation is the "cleaning up" of the site by users like you! It involves flagging, closing, commenting, editing, and sometimes deleting posts. It also involves "implicit" moderation — not doing anything considered inappropriate for this site (e.g. getting involved in long comment discussions which would be better off on chat).

Why should you care? Well, in the end, this is your site. You are the community, and by and large you get to decide the path it will take. Helping out by participating in community moderation keeps this site on topic and clean, all in all a fun place to learn from. Neglect community moderation, and it slowly goes on to becoming more and more like most places on the Internet — an untamed wilderness that's no fun to be at.

Yes, as moderators, it is our job to keep the site clean. But we cannot do it without participation from the community. We have too many posts coming in to be able to read through all o

@sklivvz
sklivvz / proforma.json
Last active October 9, 2015 11:37
ProForma config file for Skeptics
callback([{
"name": "[Q] Improper use of comments.",
"description": "According to our <a href=\"http://$SITEURL$/privileges/comment\">Privileges section</a>, you should only use comments to request clarification from the author or leave _constructive_ criticism that guides the author in improving his post. Review the <i>When shouldn't I comment?</i> section and avoid off topic comments."
}, {
"name": "[Q] Not notable.",
"description": "We only focus our attention on widely-held claims, or claims sustained by famous people. On the other hand, I could not find any example of people believing the one you present and your question has been put on hold as off-topic as it is our policy. <a href=\"http://meta.skeptics.stackexchange.com/a/883\">Provide some evidence</a> to show that the claim above is believed by numerous people to get it reinstated."
}, {
"name": "[Q] No claim.",
"description": "According to the [help/on-topic], Skeptics is for researching the evidence behind the claims