Instantly share code, notes, and snippets.

View nginx.conf.part
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server {
server_name dugovic.mooo.com;
listen 80;
View stockfish.js
This file has been truncated, but you can view the full file.
var Module = {
print: (function(stdout) {
postMessage(stdout)
})
};
var Module;
if (!Module) Module = (typeof Module !== "undefined" ? Module : null) || {};
var moduleOverrides = {};
for (var key in Module) {
View sl.sh
#!/bin/bash
x=1
clear
while [ $? -eq 0 ]
do
x=$(( $x + 1 ))
/home/lila/sl/sl -dew -$x
done
clear && fortune | cowsay
View chess_game_analyzer_v39.14.beta.py
# -*- coding: utf-8 -*-
"""
I. About the script
1. It takes a pgn file with games in it and analyze those
games there one by one if there are more than one game
2. It mainly uses Stockfish uci engine during development.
Other uci engines can be used provided those engines support
multipv mode
View E4_Best_by_Test.user.js
// ==UserScript==
// @name E4, Best by Test
// @namespace https://github.com/ddugovic/UserScripts
// @description Best by test!
// @author ddugovic
// @copyright 2017+, ddugovic
// @license CC0 1.0 Universal
// @match https://lichess.org/training/coordinate
// @require https://lichess1.org/assets/compiled/coordinate.js?v=1932
// @grant none
View crazyhouse-puzzles-test.epd
% Crazyhouse variant testsuite from https://chessvariants.training/
r6k/pppq2pp/3pp3/4p3/3nP1BP/2NPK1P1/PPP5/3R4[RBBNNPqrb] b - - bm B@f4+
rnb2r2/ppp3p1/4kp2/4pp1Q/3P4/8/PPP2PPP/R1B1KBNR[QBPPnn] w KQ - bm Bc4+ B@d5+
rnbk4/ppp1bp1p/8/4P3/4p3/2N5/PPP2PPP/R1B1KBNR[QRNPPqp] w KQ - bm Q@h8+ Q@g8+
r7/p1p1b1rp/b3kn2/4p1P1/3pP1n1/2NP2P1/PPP2pKP/R1BQ3R[QNPPb] w - - bm Q@d5+
r1b4r/p5pp/2pkp3/3p4/3Pp3/8/P1P2PPP/R2n1RK1[QBNNqbbnppp] w - - bm B@c5+ B@b4+
r3nr1b/ppp2p1k/6p1/4P1qB/3PK3/4Q3/PPP3PP/R7[RBBNNPPnpp] b - - bm Qf5+
r4r1k/ppp2pp1/3N4/3Np3/B5p1/6B1/PP3Pp1/R1BQ1RK1[QNPPPbnpp] w - - bm Q@h6+
1r5k/1P2Q1p1/p3Qnb1/1pp3N1/8/2P1BPp1/PP4P1/R4R1K[BBNrnppppp] w - - bm N@f7+
1rRq1r2/1PppkpQp/p3bN2/1pb1pp2/4P3/2P4N/PP4PP/Rb5K[BNnp] w - - bm Rxd8
View pawn_encoder.rb
# Program to encode pawns as bitmasks from a FEN
# Usage: ruby pawn_encoder.rb "rn3rk1/4bpp1/pq2bn1p/2pp4/B6B/2N1PN2/PP3PPP/2RQ1RK1"
def encode(fen)
board = fen.gsub("8"," 7").gsub("7"," 6").gsub("6"," 5").gsub("5"," 4").gsub("4"," 3").gsub("3"," 2").gsub("2"," 1").gsub("1"," ")
wpawnsA = board.gsub(/[^P\/]/,"0").gsub(/P/,"1").split("/")
bpawnsA = board.gsub(/[^p\/]/,"0").gsub(/p/,"1").split("/")
wpawnsB = wpawnsA.rotate
bpawnsB = bpawnsA.rotate(-1)
View run.pl
#!/usr/bin/perl
$ENV{'STBWDIR'} = '.';
$ENV{'STBZDIR'} = '.';
$ENV{'STBSTATSDIR'} = '.';
$ENV{'LTBWDIR'} = '.';
$ENV{'LTBZDIR'} = '.';
$ENV{'LTBSTATSDIR'} = '.';
$ENV{'GTBWDIR'} = '.';
$ENV{'GTBZDIR'} = '.';
View hillclimbing.py
import gym
import numpy as np
def run_episode(env, parameters):
observation = env.reset()
totalreward = 0
#for 200 timesteps
for _ in xrange(200):
#env.render()
#initalize random weights
View audiosynth.view.js
var fnCreateKeyboard = function(keyboardElement) {
// Generate keyboard
// This is our main keyboard element! It's populated dynamically based on what you've set above.
visualKeyboard = document.getElementById('keyboard');
selectSound = document.getElementById('sound');
var iKeys = 0;
var iWhite = 0;
var notes = __audioSynth._notes;