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
output('r = 1') | |
get_remote_data('https://raw.githubusercontent.com/curran/data/gh-pages/worldFactbook/GDPPerCapita.csv', (csv_str) => { | |
let vals = []; | |
for (l of Papa.parse(csv_str).data) { | |
vals.push(l[1]) | |
} | |
Calc.setExpression({ | |
id: 'mytable', | |
type: 'table', |
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 Desmos script | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://*.desmos.com/calculator* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=desmos.com | |
// @grant unsafeWindow | |
// @grant GM_xmlhttpRequest |
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
local Names = {} | |
local CharIndex = {} -- { [index_str] = { word1, word2, word3, ...}, ... } | |
local CharIndexPos = {} -- { [index_str] = { char_pos1, char_pos2, char_pos3, ...}, ... } | |
local MaxIndexLen = 2 -- 1: start with {x}, 2: start with {xx}, 3: start with {xxx} | |
-- word: asdf asdf zxcv | |
-- fuzzy match: adfasf, aszx, asdfasdf, as as | |
local RandChars = 'abcdefghijklnmopqrstuvwxyz' | |
local function rand_word(n) |
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
#! /usr/bin/env ruby | |
# Support formats | |
# xlsx: Excel 2007 - 2013 | |
# xlsm: Excel 2007 - 2013 | |
# xls: Excel 97, | |
# ods: LibreOffice / OpenOffice.org | |
# xml: Excel 2002 2003 XML | |
# | |
# More see roo-rb/roo |
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
#! /usr/bin/env ruby | |
# Usage: | |
# tls_cert_checker xjz.pw aliyun.com yourdomain.com | |
# tls_cert_checker /path/to/your_hosts | |
# hosts_file: split hosts with new line "\n", ignore empty line | |
require 'socket' | |
require 'openssl' |
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
#!/usr/bin/env ruby | |
def generate_dir_links(dir) | |
level_names = [] | |
last_level = 0 | |
Dir['*.md'].sort.each_with_object([]) do |file, md| | |
next if file == 'Home.md' | |
path = file.split('--') | |
name = path.last |
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(){ | |
var $toggle_btn = $("<a href='javascript: void(0);'>My Label Switch</a>"); | |
$('.filter-item.reset-filters').append($toggle_btn); | |
$toggle_btn.click(function(e){ | |
var $issues = $('li.issue[data-labels*=1290],li.issue[data-labels*=2697]'); | |
if ($($issues[0]).hasClass('hide-issue')) { | |
$issues.removeClass("hide-issue"); | |
} else { | |
$issues.addClass("hide-issue"); |
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
ITEMS = [ | |
{ weight: 3, value: 200}, | |
{ weight: 10, value: 500}, | |
{ weight: 100, value: 30}, | |
{ weight: 200, value: 2000}, | |
{ weight: 300, value: 500}, | |
{ weight: 50, value: 50}, | |
{ weight: 190, value: 1000}, | |
{ weight: 200, value: 1500}, | |
] |
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
# class Unit | |
# include GA | |
# attr_accessor :genome, :value | |
# | |
# def self.random_new | |
# self.new(10.times.map { rand(2) == 1 }) | |
# end | |
# | |
# def initialize(genome) | |
# @genome = genome.dup |
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
ITEMS = [ | |
{ weight: 3, value: 200}, | |
{ weight: 10, value: 500}, | |
{ weight: 100, value: 30}, | |
{ weight: 200, value: 2000}, | |
{ weight: 300, value: 500}, | |
{ weight: 50, value: 50}, | |
{ weight: 190, value: 1000}, | |
{ weight: 200, value: 1500}, | |
] |
NewerOlder