Skip to content

Instantly share code, notes, and snippets.

View TikiTDO's full-sized avatar

TikiTDO TikiTDO

  • Toronto, Canada
View GitHub Profile
@TikiTDO
TikiTDO / SCIENCE.json
Last active January 3, 2023 17:22
SCIENCE! by ChatGPT
{
"Agricultural Science": {
"core discipline details": {
"Agronomy": {
"description": "Agronomy is the science and practice of producing and using crops, including the cultivation of soil, the selection and breeding of plants, and the management of pests and other agricultural challenges. It involves the use of principles of biology, chemistry, and other scientific disciplines to improve the efficiency and sustainability of agricultural practices.",
"tasks": [
"Conducting research on the genetic, physiological, and environmental factors that affect crop growth and development",
"Developing and testing new techniques for soil management, plant breeding, and pest control",
"Analyzing data to identify trends and patterns that can inform agricultural decision-making",
"Collaborating with farmers, agribusiness professionals, and other stakeholders to implement sustainable agricultural practices",
@TikiTDO
TikiTDO / CpArcticCircle.tsx
Created January 1, 2021 19:10
Arctic Circle implementation based on https://www.youtube.com/watch?v=Yy7Q8IWNfHM
/* eslint-disable no-nested-ternary */
/* eslint-disable no-console */
/* eslint-disable react-native/no-inline-styles */
/* eslint-disable no-bitwise */
/**
* Copyright © 2020 TikiTDO
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the “Software”), to deal in
* the Software without restriction, including without limitation the rights to
# Fix imports to point to correct locations
(base = "/home/tiki/karma-development/submodules/") && nil
(core = Dir["#{base}/core-react-module/src/**/*.js"].map {|f| f.gsub("#{base}/core-react-module/src/", "")}) && nil
(worker = Dir["#{base}/worker-react-app/src/**/*.js"].map {|f| f.gsub("#{base}/worker-react-app/src/", "")}) && nil
(path_to_module = (core + worker).map {|f| module_name = Pathname.new(f).basename.to_s.gsub(/(.web)?.js$/, ""); local_path = f.gsub(/(.web)?.js$/, ""); [local_path, module_name]}.to_h) && nil
(module_to_path = (core + worker).map {|f| module_name = Pathname.new(f).basename.to_s.gsub(/(.web)?.js$/, ""); local_path = f.gsub(/(.web)?.js$/, ""); [module_name, local_path]}.to_h) && nil
groups = {}
(group_to_module = (core + worker).map {|f| module_name = Pathname.new(f).basename.to_s.gsub(/(.web)?.js$/, ""); group = Pathname.new(f).dirname.to_s; groups[group] ||= []; groups[group].push(module_name)}) && nil
var data = "0011010111"
var number = parseInt(data, 2)
var toSend = {}
if (number & 1 << 0) toSend.first = true
if (number & 1 << 1) toSend.second = true
if (number & 1 << 2) toSend.third = true
if (number & 1 << 3) toSend.fourth = true
if (number & 1 << 4) toSend.fifth = true
if (number & 1 << 5) toSend.sixth = true
@TikiTDO
TikiTDO / janguages.java
Created October 6, 2016 23:11
Languages
tempLocales.put("ara", "Arabic");
tempLocales.put("ben", "Bengali");
tempLocales.put("bur", "Burmese");
tempLocales.put("zho", "Cantonese");
tempLocales.put("eng", "English");
tempLocales.put("fra", "French");
tempLocales.put("ger", "German");
tempLocales.put("guj", "Gujarati");
tempLocales.put("hin", "Hindi");
tempLocales.put("ita", "Italian");
@TikiTDO
TikiTDO / gps_to_words.js
Created June 15, 2016 17:15
GPS to Words algorithm
(function () {
var words = ["the", "of", "and", "to", "a", "in", "for", "is", "on", "that", "by", "this", "with", "i", "you", "it", "not", "or", "be", "are", "from", "at", "as", "your", "all", "have", "new", "more", "an", "was", "we", "will", "home", "can", "us", "about", "if", "page", "my", "has", "search", "free", "but", "our", "one", "other", "do", "no", "information", "time", "they", "site", "he", "up", "may", "what", "which", "their", "news", "out", "use", "any", "there", "see", "only", "so", "his", "when", "contact", "here", "business", "who", "web", "also", "now", "help", "get", "pm", "view", "online", "c", "e", "first", "am", "been", "would", "how", "were", "me", "s", "services", "some", "these", "click", "its", "like", "service", "x", "than", "find", "price", "date", "back", "top", "people", "had", "list", "name", "just", "over", "state", "year", "day", "into", "email", "two", "health", "n", "world", "re", "next", "used", "go", "b", "work", "last", "most", "products", "music", "buy", "data", "make"
@TikiTDO
TikiTDO / fast_v4_uuid.js
Last active July 2, 2016 12:15
A reasonably fast, yet still readable implementation of UUID v4 in JS. Just about the fastest possible without ASM and extensive loop unrolling.
// RFC-4122 - UUID from Crypto Random Source (Version 4)
// https://www.ietf.org/rfc/rfc4122.txt
(function () {
var crypto = self.crypto || self.msCrypto;
var hex_values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
var template = 'xxxxxxxx-xxxx-4xxx-Rxxx-xxxxxxxxxxxx';
var template_length = template.length;
Math.uuid = function() {
// Generate 16 random 8-bit values, which will be clamped down to 4-bits below
(function () {
// Do nothing if mouse events are not supported
if (!MouseEvent) return;
// Init
var LEFT_KEY = 37;
var RIGHT_KEY = 39;
// Click event for the back button
var click_event = new MouseEvent('click', {view: window, bubbles: true, cancelable: true});
@TikiTDO
TikiTDO / js_proxy.coffee
Created May 31, 2016 08:57
All the handlers for a JS proxy object
new Proxy {},
getPrototypeOf: (target) ->
return
setPrototypeOf: (target, prototype) ->
return
isExtensible: (target) ->
return
preventExtensions: (target) ->
return
getOwnPropertyDescriptor: (target, prop) ->
@TikiTDO
TikiTDO / slim_js_minifier.rb
Last active May 25, 2016 02:14
Minify embedded javascripts in slim when not in development (Ruby 2+)
if !Rails.env.development? && defined? Slim::Embedded::JavaScriptEngine
module Slim
# Collector to extract JS from compiled templates
class JsCollector < Interpolation
def call(exp)
@collected = ''
super(exp)
@collected
end