Skip to content

Instantly share code, notes, and snippets.

View taufik-nurrohman's full-sized avatar
🍁
I ❤ U

Taufik Nurrohman taufik-nurrohman

🍁
I ❤ U
View GitHub Profile
@taufik-nurrohman
taufik-nurrohman / accessible-custom-select-box.html
Last active June 7, 2021 03:30
A custom select box draft to be used on Mecha’s control panel extension.
<!DOCTYPE html>
<meta charset="utf-8">
<title>Accessible Custom Select Box by Taufik Nurrohman</title>
<!--onsele
The MIT License (MIT)
@taufik-nurrohman
taufik-nurrohman / .vimrc
Last active November 12, 2020 06:36
Generic Vim Settings
" Set default encoding
set encoding=utf-8
" Show line number(s)
set number
set ruler
" Enable line wrap
set wrap

elementaryOS Apps and Configs

⚠️ No longer maintained! ⚠️

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common
@taufik-nurrohman
taufik-nurrohman / Tiny JavaScript tokenizer.js
Created November 1, 2020 01:27 — forked from borgar/Tiny JavaScript tokenizer.js
A compact tokenizer written in JavaScript.
/*
* Tiny tokenizer
*
* - Accepts a subject string and an object of regular expressions for parsing
* - Returns an array of token objects
*
* tokenize('this is text.', { word:/\w+/, whitespace:/\s+/, punctuation:/[^\w\s]/ }, 'invalid');
* result => [{ token="this", type="word" },{ token=" ", type="whitespace" }, Object { token="is", type="word" }, ... ]
*
*/
@taufik-nurrohman
taufik-nurrohman / lexer.js
Created October 11, 2020 14:28 — forked from pepasflo/lexer.js
A regex-based javascript lexer / scanner / tokenizer
#!/usr/bin/env node
var assert = require('assert');
// Each lexed token is a array of three integers:
// 1. the "token type": an index into the list of token patterns.
// 2. the index into the input string marking the start of this token.
// 3. the length of the token.
// The list of "token types" which our lexer understands:
@taufik-nurrohman
taufik-nurrohman / index.html
Created November 10, 2012 03:52
A CodePen by Taufik Nurrohman. JQuery Slideshow, Like Nivo Slider
<figure id="slider">
<div class="container">
<img src="http://lorempixel.com/400/250/sports/1" alt="Lorem ipsum dolor sit amet...">
<img src="http://lorempixel.com/400/250/sports/2" alt="Consectetuer adipiscing elit...">
<img src="http://lorempixel.com/400/250/sports/3" alt="Sed diam nonummy nibh euismod tincidunt...">
<img src="http://lorempixel.com/400/250/sports/4" alt="Ut laoreet dolore magna aliquam erat volutpat...">
</div>
<figcaption></figcaption> <!-- slideshow caption -->
<nav id="slider-nav"></nav> <!-- navigation -->
</figure>
@taufik-nurrohman
taufik-nurrohman / liquid-template-list-sentence-from-array.liquid
Created July 7, 2019 15:57
Generate text “foo, bar, baz and qux” from array input in Liquid by https://github.com/mecha-cms
{% assign total_items = items.size %}
{% for item in items %}
{% if forloop.index > 1 %}
{% if forloop.index != total_items %}, {% else %} and {% endif %}
{% endif %}
{{ item }}
{% endfor %}
<style>
div {
width: 200px;
height: 200px;
background: lime;
border-radius: 100%;
position: relative;
}
span {
position: absolute;
<style>
nav {
position: relative;
background: orange;
color: black;
}
nav ul,
nav li {
margin: 0;
padding: 0;
@taufik-nurrohman
taufik-nurrohman / magic-methods.js
Created May 6, 2019 10:37 — forked from loilo/magic-methods.js
PHP Magic Methods in JavaScript
function magicMethods (clazz) {
// A toggle switch for the __isset method
// Needed to control "prop in instance" inside of getters
let issetEnabled = true
const classHandler = Object.create(null)
// Trap for class instantiation
classHandler.construct = (target, args) => {
// Wrapped class instance