Skip to content

Instantly share code, notes, and snippets.

import ts, { factory } from "typescript";
export function transformerFactory(context: ts.TransformationContext) {
function visitNode(node: ts.Node): ts.Node {
const newNode = ts.visitEachChild(node, visitNode, context);
if (
ts.isJsxOpeningElement(newNode) ||
ts.isJsxSelfClosingElement(newNode)
) {
return appendSourceMapAttribute(newNode.getSourceFile(), newNode);
@omrilotan
omrilotan / hello-world.svg
Last active October 6, 2022 00:36
Rick HTML in SVG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hatsusato
hatsusato / kmc-advent-2017.md
Last active November 25, 2023 05:46
gpg のはなし

gpg のはなし

この記事は [KMC Advent Calendar 2017][advent] の 10 日目の記事です。 昨日の記事は tron 君 ([id:tron_kmc][tron-id]) の[今年の活動を振り返る - tron-Factory 業務日誌][tron]でした。 はたち:tada:めでたい:congratulations:

はじめに

KMC 6 回生の hatsusato です。 修士 2 回生ともなると研究にかまけて KMC 活動がおろそかになっているので、この場を借りて申し訳程度に KMC 活動をしようと思います。

@RavenHursT
RavenHursT / main-app.client.js
Last active September 30, 2022 03:10
React .renderToStaticNodeStream() example w/ redux and react-router
import ReactDOM from 'react-dom'
import { createStore, applyMiddleware } from 'redux'
import getRootEpic from '../../store/epics/root.epic'
import {createEpicMiddleware} from 'redux-observable'
import reduxLogger from 'redux-logger'
import { Provider } from 'react-redux'
import MainApp from './main-app.component'
import { BrowserRouter } from 'react-router-dom'
import appReducers from '../../store/reducers'
import { CookiesProvider } from 'react-cookie'
@WebReflection
WebReflection / hyper-nitty-gritty.js
Last active May 30, 2023 06:09
hyperHTML, the nitty gritty
// used to retrieve template content
const templates = new WeakMap;
// used to retrieve node updates
const updates = new WeakMap;
// hyperHTML, the nitty gritty
function hyperHTML(chunks, ...interpolations) {
// if the static chunks are unknown
@jaredpalmer
jaredpalmer / prefetch.js
Created October 19, 2017 14:27 — forked from acdlite/prefetch.js
Prefetching in React
function prefetch(getKey, getValue, getInitialValue, propName) {
const inFlight = new Set();
const cache = new Map();
return ChildComponent => {
return class extends React.Component {
state = {value: getInitialValue(this.props)};
componentWillReceiveProps(nextProps) {
const key = getKey(nextProps);
if (cache.has(key)) {
// Use cached value
@dmouse
dmouse / Dockerfile
Last active June 2, 2022 20:52
Run Firefox or Google Chrome into a Docker container | based on http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
FROM ubuntu:14.04
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000 && \
mkdir -p /home/developer && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:${uid}:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown ${uid}:${gid} -R /home/developer
@ken-okabe
ken-okabe / #「純粋関数型」 &「副作用」というトリッキーワードについて想うこと『裸の王様』
Last active December 13, 2022 08:04
「純粋関数型」 &「副作用」というトリッキーワードについて想うこと『裸の王様』
[関数型言語のウソとホント](http://qiita.com/hiruberuto/items/810ecdff0c1674d1a74e)
に引き続き、
[純粋関数型JavaScriptのつくりかた](http://qiita.com/hiruberuto/items/810ecdff0c1674d1a74e)
という、とても有意義な記事を @hiruberuto 氏が連発しておられます。
この一連の記事を起点にして思うことをいくつか共有します。
-----