Skip to content

Instantly share code, notes, and snippets.

@antun
antun / gist:50d140a8ddb0ce05ba6c79e211c15607
Created November 14, 2023 19:27
tictactoe_combinations.js
/*
* Write a program that plays every possible tic-tac-toe game, and then prints the number of valid, completed games
*/
var gameCount = 0;
var board = [null, null, null, null, null, null, null, null, null];
var player0Pointer = 0;
@antun
antun / stopwatch.ino
Created September 12, 2022 17:25
Sunfounder AD Ultrasonic Kit Lesson 13 Stopwatch
/*
* 秒计时器
* 使用定时器1定时0.1秒溢出,设置计数值count,每0.1秒加1,再设置变量n,当
* count加到10,即1秒,n加1,也即n便是n秒
* 计时到10000秒归零
*/
#include <TimerOne.h>
int a = 2;
int b = 3;
@antun
antun / testRut.js
Created April 7, 2021 16:31
Chile RUT Validation
var ruts = [
'12.678.579-8', // Valid - with extra digits
'76086428-5', // Valid
'220604497', // Valid no dash
'12531909-2', // Valid
'76.498.451-K', // Valid - with K verification number
'76086428', // Invalid missing verificationNumber
'12.678.579-7', // Invalid verificationNumber
'76.498.451-0', // Invalid verificationNumber
@antun
antun / index.html
Created August 21, 2019 20:39
Minimal Configure - YCC
<header class="site-header">
<!-- adding a dummy header like most sites will already have -->
<h1 class="header-title">Configure 3.134.1 <span class="configure-reference-type">YCC Test Page</span></h1>
<div class="demo-links" style="display:none">
<a href="../">other demos</a>
<a href="#">source</a>
<a href="#">download</a>
<a href="#">edit</a>
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
/**
* @license
* lodash 3.10.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -o ./lodash.js`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// var _ = require('./lib/lodash');
console.log("Browserified data loaded");
console.log("If lodash works you should get a random number here: ", _.random(0,5));
},{}]},{},[1]);
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import sys
import codecs
import pprint
from openpyxl import load_workbook
@antun
antun / jsonp2json
Last active December 20, 2018 18:58
#!/usr/bin/env python
import sys
rawinput = sys.stdin.read()
output = rawinput[ rawinput.index("(") + 1 : rawinput.rindex(")") ]
print(output)
@antun
antun / csv2xlsx.py
Last active August 29, 2015 13:58 — forked from konrad/csv2xlsx.py
#!/usr/bin/env python
"""
FUNCTION: Converts a CSV (tab delimited) file to an Excel xlsx file.
Copyright (c) 2012, Konrad Foerstner <konrad@foerstner.org>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.
@antun
antun / lzx.vim
Created February 23, 2013 00:30
OpenLaszlo LZX Sytax file
so $VIMRUNTIME/syntax/xml.vim
let b:current_syntax = "lzx"
syn region lzxScript start=+<script>+ end=+</script>+ extend containedin=xmlRegion contains=lzxCData,xmlTag,xmlEqual,xmlEndTag fold keepend
syn region lzxMethod start=+<method+ end=+</method>+ extend containedin=xmlRegion contains=lzxCData,xmlTag,xmlEqual,xmlEndTag fold keepend
syn region lzxEventHandler start=+\Won\w\{-}="+ end=+"+ containedin=xmlTag contains=xmlAttrib,xmlEqual,lzxScriptAttribute,lzxAttributeQuote contained keepend
syn region lzxScriptAttribute matchgroup=lzxAttributeQuote start=+="+ end=+"+ contained