Skip to content

Instantly share code, notes, and snippets.

@mkastner
mkastner / compsition.js
Created Mar 28, 2022
Composition/Inheritance JavaScript
View compsition.js
// Part I: objects and composition
const Person = {
set givenName(givenName) {
this._givenName = givenName;
},
set familyName(familyName) {
this._familyName = familyName;
},
fullName() {
@mkastner
mkastner / gist:afdec77bcea9db437be8b3b693cafa3e
Created Mar 16, 2018
Webpack array include before babel-polyfill call
View gist:afdec77bcea9db437be8b3b693cafa3e
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1]
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
@mkastner
mkastner / prawn hyphenation issue
Created Apr 29, 2012
When using column_box hyphenation character is being redered in last line of parargraphs
View prawn hyphenation issue
require 'prawn'
class Hyphen < Prawn::Document
def initialize
super(:margin => [10,10,10,10], :page_size => 'A4')
column_box([0, cursor], columns: 2, width: bounds.width) do
text "This is a test where the very important Hy#{Prawn::Text::SHY}phe#{Prawn::Text::SHY}na#{Prawn::Text::SHY}tion works fine here, but which contains Hy#{Prawn::Text::SHY}phe#{Prawn::Text::SHY}na#{Prawn::Text::SHY}tion\n in the last line of the paragraph Hy#{Prawn::Text::SHY}phe#{Prawn::Text::SHY}na#{Prawn::Text::SHY}ted\n"
bounds.move_past_bottom
text "second column"