Tag:code
All the articles with the tag "code".
k-th Largest Number from a List of Digits
Posted on:November 12, 2019It took me 2 years of rumination and good-ol’ procrastination to finally get my website back up on its feet. I think I might have more to say…
Balanced Augmented Interval Trees
Posted on:November 10, 2019Runder is a rudimentary clone of CodePen that I wrote to see how much I could accomplish in a span of 24 hours. It leverages on Google Caja’s…
A Redis Recipe for Lists of Recency
Posted on:October 17, 2019Link. When you get to this stage, most of the tutorials and online resources available to you are much less useful because they assume you’re…
Longest Consecutive Sequence
Posted on:October 16, 2019When studying I find that writing notes help me to process that information better, even if I never go back to those notes. Since I’m such a…
Building a Dynamic UI System at Carousell (Part 3)
Posted on:March 5, 2019In this post, I want to talk about some of the technical details behind this site and the workflow that I have for writing. This site is built…
Building a Dynamic UI System at Carousell (Part 2)
Posted on:February 26, 2019I needed to add a form to Active Admin so that a client could upload tsv files, which would be parsed and the data added to the database.…
Building a Dynamic UI System at Carousell (Part 1)
Posted on:February 19, 2019I was handed an EC2 instance running 12. 10 (Quantal Quetzal), which had reached EOL. Due to some reasons, upgrading wasn’t an option. When I…
An Interesting Exercise in Dynamic Programming
Posted on:May 8, 2016(This post was originally posted on Cubicle Rebel’s engineering blog. Check it out! )Our clients rely on us to provide rock-solid long-term…
0-1 Knapsack Problem in Python
Posted on:April 22, 2016Aurora’s Github repoTLDR: I learned Erlang and wrote a JSON API server called Aurora for a school project. IntroductionI recently concluded a…
Iterative Tree Traversals in Python
Posted on:April 21, 2016Single table inheritance (STI) in Rails allows you to store Ruby subclasses in the same database table. Let’s get started with a brand-new…
Jekyll Variable in SCSS Files
Posted on:April 16, 2016The first in a series of Nginx posts. The information here is heavily inspired from my reading of Clément Nedelcu’s excellent book Nginx HTTP…
Custom Liquid Tags
Posted on:March 30, 2016The second in a series of Nginx posts. Nginx runs two different types of processes: the master process and worker processes. Master ProcessThis…
Data Structures in TypeScript
Posted on:March 28, 2016The third post in the Nginx series. Nginx configuration consists essentially of key-value pairs called directives, which can be organised and…
Migrating to Visual Studio Code
Posted on:March 26, 2016The Core module controls essential Nginx features, some of which will have a direct impact on performance, such as the number of worker…
Exposing React Performance Tools in the Browser Console
Posted on:March 25, 2016Nginx’s HTTP module comes with its own set of directives and structure blocks. Structure BlockshttpThe http block acts as the overarching…
Circular References in GraphQL Type Definitions
Posted on:March 19, 2016Some notes I took while watching Rebuilding a Web Server, a brief walkthrough by Marc-André Cournoyer on writing a simple Rack-compliant web…
Exporting ES6 Library Modules as Global Scripts with Webpack
Posted on:March 16, 2016Today, we investigate Rails’ boot sequence by observing what happens when we run rails console. Part 2 will look at rails server. Github…
Importing .rdb files into Redis with Protocol Streams
Posted on:March 1, 2016While going through Jasmine’s source code, I came across a weird idiom: function attemptAsync(queueableFn) { var clearTimeout = function ()…
Partial Functions in Haskell Prelude
Posted on:February 29, 2016You will learn how to scaffold a React project from scratch with Karma and webpack. I’ve tried to make it as unopinionated as possible.…
Agnostic HTTP Endpoint Testing with Jasmine and Chai
Posted on:February 27, 2016This post will explore some more niceties that using webpack provides. ESLintESLint functionality is provided by way of eslint-loader: npm…
Submit Behaviour in the button HTML Element
Posted on:February 10, 2016I recently wrote Topick, a library for extracting keywords from HTML documents. Check it out here! The initial use case for it was to be used…
Preprocessing in Searchkick
Posted on:February 4, 2016This post covers quick and dirty TCP load balancing with HAProxy, and some specific instructions for Graylog2. (As an aside, if you’re looking…
How Ruby Objects Are Implemented
Posted on:January 29, 2016This post is a fairly comprehensive reference to Advanced Policy Firewall (apf-firewall), a user-friendly interface of iptables. We will also…
Pretty Form Validation with Redux Form
Posted on:January 26, 2016Technical Context: Ubuntu 14. 04, first Graylog2 IP: 11. 11. 11. 11, second Graylog2 IP: 22. 22. 22. 221. Install Graylog2Instructions here. (Note…
How Closures Actually Work
Posted on:January 25, 2016There are 4 ways to create new objects in JavaScript: Object initializers, also known as literal notationObject. createConstructorsES6…
MVC Organisation with Express and Thinky
Posted on:January 17, 2016The DOM, as implemented in browsers, is a model to represent a HTML or XML document as a tree of nodes, and presents an API to access and…
How Ruby Classes Are Implemented
Posted on:January 10, 2016Timers in JavaScript are used to schedule functions to be called at a later time. It does so by setting up a timer which, when it’s done…
Logging and Notifications with Rogger, Graylog2 and Twilio
Posted on:January 9, 2016Constructors in JavaScript have gotten a bad rep because there’s nothing stopping the unwitting programmer from doing something like…
Rogger 0.1.2 Released
Posted on:January 7, 2016Technical Context: Composer 1. 0-dev, PHP 5. 5. 27, OS X YosemiteInstall Composer: $ cd ~ $ curl -sS https: //getcomposer. org/installer | phpThis…
Invalid Gemspec
Posted on:January 6, 2016This is a nifty one. I wanted to create manual categories for my coding posts, so I ended up doing something like this in my coding/index. html…
Cathode, or, My Favourite Music from 2015
Posted on:January 3, 2016It’s a good idea to run brew every day. Instead of cron, I use launchd instead. launchd has better integration with system behavior, such as…
Setting up Golang with Fish and Homebrew
Posted on:December 18, 2015I originally wrote this post to help me understand and internalize HMMs and the Viterbi algorithm, but school got too busy and I couldn’t…
Adding MiniMagick support to carrierwave-video-thumbnailer
Posted on:December 5, 2015Caveat emptor: I’m currently using 3. 0. 6 of redux-form. As with most things on the bleeding edge, this post will probably be irrelevant in a…
mySQL Native Bindings in OS X El Capitan
Posted on:December 1, 2015Caveat Emptor: As far as I can tell, this routing functionality will continue to work in Express 5, which at this time of writing is still in…
OpenSSL woes with Ruby 2.2.3 and rvm
Posted on:November 30, 2015If anyone is getting any errors along the lines of the following: Original Exception: OpenSSL: : SSL: : SSLError: SSL_connect returned=1 errno=0…
Route Organisation with Express 4+
Posted on:November 27, 2015Booting up a Django project, I ran into the following problem: django. core. exceptions. ImproperlyConfigured: Error loading MySQLdb module:…
Initial Form Values with redux-form
Posted on:November 26, 2015TLDR: I forked carrierwave-video-thumbnailer and added MiniMagick post-processing support. Using good ol’ Carrierwave to upload video files to…
Viterbi's Algorithm for first-order and second-order hidden Markov models
Posted on:November 16, 2015Install Golang with Homebrew$ brew update && brew upgrade $ brew install goInstall Mercurial (optional)I’m not sure if Mercurial is strictly…
Daily brew with launchd
Posted on:November 9, 2015As a school holiday project, I made a Hugo site to document all of my favourite music from 2015, and released the theme separately as a…
Liquid Tag Parameters
Posted on:October 14, 2015A minor, but frustrating bug. While working on Rogger, I came across the following problem while bundling my local Rogger into a test…
Installing Composer Globally
Posted on:September 18, 2015Rogger v0. 1. 2 has been released - a patch that makes logging to Graylog2 even easier. For example, in a Rake task you can do something…
JavaScript Object Creation and Prototype Chains
Posted on:August 24, 2015Rogger 0. 1. 2 was released yesterday, so check it out if you need a way to log your Rails applications / Rake tasks on Graylog2! Anyway, this…
JavaScript Timers
Posted on:August 8, 2015Next post: How Ruby Classes are ImplementedI’m currently reading Pat Shaughnessy’s excellent book Ruby Under a Microscope, and these are…
new-Agnostic JavaScript Constructors
Posted on:August 8, 2015Previous post: How Ruby Objects are ImplementedRuby classes are represented by a RClass structure. It’s a fairly big structure, so I’ve…
The Browser DOM
Posted on:August 5, 2015I wrote an example to demonstrate a way to organise your Express app in a MVC manner without resorting to complicated frameworks. Check it out…
Setting Up a Second Graylog2 Server Node
Posted on:August 3, 2015Like objects, closures are a mechanism for containing state. In JavaScript, a closure is created whenever a function accesses a variable…
Setting Up Advanced Policy Firewall (APF) and Brute Force Detection (BFD)
Posted on:July 31, 2015I made a nice and unobtrusive animation for form validation with redux-form: aTo implement it, I made a FormInput component: import React, {…
Load Balancing Graylog2 with HAProxy
Posted on:July 29, 2015Coming back to Jekyll from Hugo, I’d grown accustomed to shortcodes, which are awesome to keep your Markdown source as HTML-free as possible.…
Topick - JavaScript NLP library to extract keywords from HTML documents
Posted on:July 28, 2015Not sure how I only found out about this only today, but a <button> HTML element without a type attribute defaults to the submit value. Test…
Setting Up A Test-Driven React Project From Scratch - Part 2: webpack niceties
Posted on:July 23, 2015In this post, I’m going share my strategy for endpoint testing. It has a few cornerstones: It should test against a running server by sending…
Setting Up A Test-Driven React Project From Scratch - Part 1: webpack
Posted on:July 22, 2015Partial functions are functions that are not defined for all possible arguments of its specified type. The most common example of a partial…
Apply, Apply
Posted on:July 19, 2015As a preface, read this for the motivation and concept behind Redis protocol streams (as usual, Redis documentation is amazingly well written…
Rails Boot Sequence (Part 1)
Posted on:July 17, 2015After authoring a library (Remerge) using ES6 style modules, aside from consumption with npm, I also wanted to release it as a standalone…
Notes on "Rebuilding a Web Server"
Posted on:July 16, 2015When defining GraphQL types, it’s common to run into situations when two types reference each other. This is a problem because one type will…
Nginx HTTP Module and Configuration
Posted on:July 10, 2015The React docs on Performance Tools is quite lacking as to how it should be used, so I had to do some digging around to figure out how it…
Core Nginx Configuration and HTTP Load Testing with Autobench
Posted on:July 9, 2015I’ve been testing out Visual Studio Code for writing Node stuff, and I really like what I’m seeing so far. I’d like to confess that 99. 9% of…
Nginx Configuration Syntax
Posted on:July 7, 2015Took some time off this weekend to learn some TypeScript, and reimplemented some data structures as practice. I don’t think I’ll continue to…
Downloading and Installing Nginx
Posted on:July 5, 2015Coming back to Jekyll from Hugo, I’d grown accustomed to shortcodes, which are awesome to keep your Markdown source as HTML-free as possible.…
Managing Nginx Processes
Posted on:July 5, 2015You can use Jekyll site variables in top-level SCSS files. For example: {% raw %}$baseurl: '{{ site. baseurl }}'; {% endraw %} @import…
Single Table Inheritance in Rails
Posted on:June 27, 2015The 0-1 Knapsack problem is a variation on the knapsack problem with one condition: there is only one copy of each item. You may choose to…
Aurora and Learning Erlang
Posted on:May 3, 2015Tree traversals are most naturally expressed in recursion, but iterative versions are cool too, plus they take only O(1) space. Inorder…
Monitoring Processes with Monit and Slack
Posted on:March 15, 2015Given an array of building heights (with unit width), calculate the area of the largest rectangle that “fits” within these buildings. For…
Updating EOL Ubuntu Releases
Posted on:March 10, 2015For an e-commerce platform past a certain scale and size, having some sort of a dynamic UI system becomes a necessity due to the complexity…
Blogging Workflow
Posted on:December 2, 2014This is the second part in a trilogy of articles about a dynamic UI system we’ve developed at Carousell over the past one and a half years to…
Goodbye Mou, Hello StackEdit
Posted on:November 25, 2014This is the third and final part in a trilogy of articles about a dynamic UI system we’ve developed at Carousell over the past one and a half…
Things I Wish Someone Had Told Me When I Was Learning How to Code
Posted on:November 20, 2014siawyoung. com has been rewritten once again, this time with all the fanciest things you can imagine. Gatsby, Netlify CMS, Typescript, Styled…
Runder
Posted on:November 16, 2014Given an array of integers, find the length of the longest sequence that contains consecutive integers. The array is unsorted, and may contain…