Skip to content

Instantly share code, notes, and snippets.

View nimitmaru's full-sized avatar

Nimit Maru nimitmaru

View GitHub Profile
@nimitmaru
nimitmaru / uint8array-base64-convert.cljs
Last active August 17, 2023 16:12
ClojureScript utilities for converting between Base64 strings and Uint8Array binary buffers
(defn uint8array-to-base64 [buffer]
(when-not (nil? buffer)
(let [bytes (js/Uint8Array. buffer)
len (.-byteLength bytes)
binary (->> (range len)
(map #(js/String.fromCharCode (aget bytes %)))
(apply str))]
(js/window.btoa binary))))
(defn base64-to-uint8array [base64]
@nimitmaru
nimitmaru / chatgpt-compact.usercss.css
Last active April 23, 2024 08:58
UserCSS for a better ChatGPT experience
/* ==UserStyle==
@name 4/23/2024, 4:54:00 AM
@namespace github.com/openstyles/stylus
@version 1.0.0
@description Compact ChatGPT User Style. Based on https://bit.ly/3Jxj70u
@author Nimit Maru
==/UserStyle== */
@-moz-document domain("chat.openai.com") {
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
categories:
- name: HTML
questions:
- question: A tag that was popular in the early internet but now considered by it's creator to be the worst thing he's ever done for the Internet, it alternates text from being visible to invisible.
answer: What is the blink tag?
- question: Invented by this person in 1995, the web immediately captured the imaginations of developers worldwide.
answer: Tim Berners Lee
- question: This property of HTML elements allows to have other elements next to them, otherwise it's only above or below.
answer: What is display (block vs inline)
- question: EVERDAY DOUBLE! (No. 1) # A weird looking type of tag, it's long form is bang, dash, dash

#Angular part 2

Part 1 Recap

In the last workshop we covered the basics of building an Angular app. As a recap the steps included:

  1. Start with a default file to serve, typically index.html
  2. Include the Angular Library source file like any other javascript file
  3. Create a main file, app.js, that defines and initiates the angular app 'Education'

#Angular part 2

Part 1 Recap

In the last workshop we covered the basics of building an Angular app. As a recap the steps included:

  1. Start with a default file to serve, typically index.html
  2. Include the Angular Library source file like any other javascript file
  3. Create a main file, app.js, that defines and initiates the angular app 'Education'
// 06_Functional
var doubler = function(n) {
return n * 2;
};
var map = function (array, iteratorFunc) {
var returnArray = [], val;
for (var i = 0; i < array.length; i++) {
val = iteratorFunc(array[i]);
var gameOfLife = {
width: 20,
height: 20,
stepInterval: null,
createAndShowBoard: function () {
// create <table> element
var goltable = document.createElement("tbody");
// build Table HTML
var getRandNumber = function () {
return Math.floor(Math.random()*100)+1;
};
var goal = getRandNumber();
jQuery("#guess").click(function() {
var usersGuess = jQuery("#user_input").val();
usersGuess = parseInt(usersGuess);
@nimitmaru
nimitmaru / -
Created January 31, 2015 17:59
# Always sort the files
#--sort−files
# Always color, even if piping to a another program
--color
--color-match=blue
--color-filename=black
--color-lineno=red
# Use "less −r" as my pager