Skip to content

Instantly share code, notes, and snippets.

View bozbalci's full-sized avatar
🎯
Focusing

Berk Özbalcı bozbalci

🎯
Focusing
View GitHub Profile
@jon-a-nygaard
jon-a-nygaard / README-Highcharts-React-formatter.md
Last active June 3, 2019 23:07
Example of rendering React components in a Highcharts formatter function.

Example of rendering React components in a Highcharts formatter function.

The index.js file shows an example of creating a React app with Highcharts using the offical wrapper. It also demonstrates a possible solution to render React components in a Highcharts formatter function.

The helper function named formatter takes a react component and render it to a string which is returned to the Highcharts formatter. It also takes the arguments and context in the Highcharts formatter and passes them into the component as props named arguments and context

@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@jessykate
jessykate / Jekyll nd Octopress Liquid tag for MathJax.rb
Created February 18, 2011 23:37
A simple liquid tag for Jekyll/Octopress that converts {% m %} and {% em %} into inline math, and {% math %} and {% endmath %} into block equations, by replacing with the appropriate MathJax script tags.
module Jekyll
class MathJaxBlockTag < Liquid::Tag
def render(context)
'<script type="math/tex; mode=display">'
end
end
class MathJaxInlineTag < Liquid::Tag
def render(context)
'<script type="math/tex">'
end