Skip to content

Instantly share code, notes, and snippets.

View manjarb's full-sized avatar

Varis Darasirikul manjarb

View GitHub Profile
@manjarb
manjarb / answer1.js
Last active June 11, 2019 19:11
Varis Darasirikul's Pre-Test 2019
// Write a function that takes two arrays as input,
// each array contains a list of A-Z;
// Your program should return True if the 2nd array is a subset of 1st array, or False if not.
function isSubset(source, subset) {
let isShared = true;
// Create an object which will be used for store formatted subset object
// in order to reduce the duplicated string for a linear search later
let sourceObject = {};
let subsetObject = {};
@manjarb
manjarb / web-fonts-asset-pipeline.md
Created May 3, 2017 16:12 — forked from anotheruiguy/web-fonts-asset-pipeline.md
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@manjarb
manjarb / doc.md
Created September 13, 2016 10:11 — forked from oelmekki/doc.md
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.