Skip to content

Instantly share code, notes, and snippets.

@thinkaxelthink
thinkaxelthink / compress-final.js
Last active September 1, 2023 21:02
wonder compress final draft
const compress = (str) => {
let chars = str.split("");
let lastChar = null;
let charCount = 0;
let result = [];
while (chars.length > 0) {
const currChar = chars.shift();
if (lastChar !== null && currChar !== lastChar) {
@thinkaxelthink
thinkaxelthink / compress.js
Created September 1, 2023 20:49
wonder compress first draft
function compress(param) {
const charsCount = {};
let lastCharProcessed = null;
let result = [];
param.split("").forEach((s, idx, arr) => {
if (!charsCount[s]) {
charsCount[s] = 1;
@thinkaxelthink
thinkaxelthink / amperon-systems
Created April 5, 2023 18:56
My notes for Amperon software architectural interview
// original gist: https://gist.github.com/acobster/369d1ba74612e86352ffc6569fd7607e
# user
* name
* email
* ~team_id~
* roles: ['one', 'two', 'three']
* id
@thinkaxelthink
thinkaxelthink / autofruit.gist
Created April 3, 2023 16:04
AutoFruit test for Amperon
import React, { useState } from "react";
const FRUITS = [
'Açaí', 'Apple', 'Akee', 'Apricot', 'Avocado', 'Banana', 'Bilberry',
'Blackberry', 'Blackcurrant', 'Black sapote', 'Blueberry', 'Boysenberry',
'Crab apples', 'Currant', 'Cherry', 'Cloudberry', 'Coconut', 'Cranberry',
'Cucumber', 'Damson', 'Date', 'Dragonfruit', 'Durian', 'Elderberry',
'Feijoa', 'Fig', 'Goji berry', 'Gooseberry', 'Grape', 'Raisin',
'Grapefruit', 'Guava', 'Honeyberry', 'Huckleberry', 'Jabuticaba',
'Jackfruit', 'Jambul', 'Japanese plum', 'Jostaberry', 'Jujube',
alias vi='vim'
alias vice="~/vclamp/vagrant/bin/init-vmp3-vertical.sh $1 $2"
alias vmp2api='cd ~/clamp/src/vmp2_api/webroot/protected'
alias vmp2='cd ~/clamp/src/vmp2'
alias vmp2vagrant='cd ~/clamp/vagrant_temp/'
alias vmp='cd ~/clamp/src/vmp'
alias vmp3='cd ~/vclamp/src/vmp3packagedev/packages/vice/vmp3/'
alias vicevideos='cd ~/vclamp/src/vmp3' # change when vclamp has confs for vice videos
alias whitelabel='cd ~/vclamp/src/whitelabel'
@thinkaxelthink
thinkaxelthink / .vimrc
Created November 3, 2015 15:20
my vimrc
set nocompatible " be iMproved
filetype off " required!
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@thinkaxelthink
thinkaxelthink / fizzy.coffee
Created May 20, 2013 17:14
recursive fibonacci fizzbuzz
maxFibs = 50
fibs = [1,1]
fibGen = (n) ->
if fibs[n]? is false
fibs[n] = fibGen(n - 1) + fibGen(n - 2)
fibs[n]
fizzy = (i) ->
if i is undefined then i = 0
@thinkaxelthink
thinkaxelthink / index.html
Last active December 13, 2015 18:28
trying out cmx.js
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg);">
<scene id="scene1">
<label t="translate(0,346)">
@thinkaxelthink
thinkaxelthink / gist:3308134
Created August 9, 2012 21:14 — forked from mikedory/gist:3299167
McKayla It
javascript:(function(){ var body=document.getElementsByTagName("body")[0];var mckayla="http://f.cl.ly/items/1A1w013w0Q3p380a2N3x/mckayla.png";var mckaylaDiv=document.createElement("img");mckaylaDiv.src=mckayla;mckaylaDiv.style.position="absolute";mckaylaDiv.style.width="300px";mckaylaDiv.style.right=0;mckaylaDiv.style.bottom=0;body.appendChild(mckaylaDiv) })();