Skip to content

Instantly share code, notes, and snippets.

View xmonkee's full-sized avatar

Mayank Mandava xmonkee

View GitHub Profile
@xmonkee
xmonkee / vscode-theme.json
Created February 22, 2024 03:27
Default VSCode themes for Zed
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Visual studio code themes",
"author": "Microsoft",
"themes":[
{
"name": "Light (Visual Studio)",
"appearance": "light",
"style": {
"border": null,
const testCases = [
['12 de julio de 2023', '2023-07-12'],
['11 de Julio de 2023.', '2023-07-11'],
['12/07/2023', '2023-07-12'],
['23 de mayo de 2023', '2023-05-23'],
['Domingo, 09 de julio de 2023', '2023-07-09'],
['29 de junio de 2023', '2023-06-29'],
['13 de julio de 2023', '2023-07-13'],
['09/06/2023', '2023-06-09'],
['27 de Abril de 2023', '2023-04-27'],
-- title: TIC-80 Speed test
-- author: Mayank Mandava, mayankmandava@gmail.com
-- desc:
-- site: website link
-- license: MIT License (change this to your license of choice)
-- version: 0.1
-- script: lua
music(0)

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@xmonkee
xmonkee / Convert between time zones .java
Last active August 29, 2015 14:23
Convert between time zones
/* http://www.java2s.com/Code/Java/Development-Class/Converttimebetweentimezone.htm */
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;
public class Main {
public static void main(String[] args) {
Calendar localTime = Calendar.getInstance();
localTime.set(Calendar.HOUR, 17);
@xmonkee
xmonkee / fib.clj
Last active August 29, 2015 14:17
;Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
;1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
;By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
;Extra: Give a solution in two different languages.
(def fib (cons 0 (cons 1 (lazy-seq (map + fib (rest fib))))))
(def answer (->> fib
(take-while #(<= % 4000000))
(filter even?)
(reduce +)))
@xmonkee
xmonkee / Concordance.py
Created January 22, 2015 08:02
Concordance generator
try:
from xml.etree.cElementTree import XML
except ImportError:
from xml.etree.ElementTree import XML
import zipfile
"""
Module that extract text from MS XML Word document (.docx).
(Inspired by python-docx <https://github.com/mikemaccana/python-docx>)
@xmonkee
xmonkee / 0_reuse_code.js
Created April 28, 2014 14:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
;"Find number of disjoint islands in a square matrix of 0's and 1's"
(defn rand-mat [size]
"Make a random matrix of 1's and 0's"
(vec (for [i (range size)]
(vec (for [j (range size)]
[(-> 2 rand int) [i j]])))))
(defn print-mat [mat]
"Print the matrix"
@xmonkee
xmonkee / Untrusted level 13
Last active July 19, 2016 10:36
My solution
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/