Skip to content

Instantly share code, notes, and snippets.

@vonwao
vonwao / digest-2026-01-28.html
Created January 28, 2026 16:43
News Digest — Week of Jan 22-28, 2026 (AI, Dev, Indie Hacking, Strategy)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>News Digest — Week of Jan 22-28, 2026</title>
<style>
* { box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
import React from 'react';
import * as N from 'react-native';
import styled from 'styled-components';
import {
compose,
space,
color,
layout,
typography,
flexbox,
import React from 'react';
import PropTypes from 'prop-types';
import debounce from 'lodash/debounce';
class OnChangeDebounce extends React.Component{
constructor(props){
super(props);
this.isValueSourceProps = this.props.hasOwnProperty(this.props.valueProperty);
this._createDebounceFunction(props);

Styled component use case

Styled component as standard react component

avoid creating middleware react component

before

const StyledIcon = styled(Icon)``;
export const HomeIcon = () => <StyledIcon uri="icn-home.svg" />;
import React from 'react';
const PostList = ({posts}) => (
<div>
<ul>
{posts.map(post => (
<li key={post._id}>
<a href={`/post/${post._id}`}>{post.title}</a>
</li>
))}
@vonwao
vonwao / routes.jsx
Created January 29, 2016 21:48
mantra sample
import React from 'react';
import {FlowRouter} from 'meteor/kadira:flow-router';
import {mount} from 'react-mounter';
import MainLayout from '/client/modules/core/components/layout.main.jsx';
import PostList from '/client/modules/core/containers/postlist';
import Post from '/client/modules/core/containers/post';
import NewPost from '/client/modules/core/containers/newpost';
export default function (injectDeps) {
/** @jsx React.DOM */
'use strict';
// Components wrapping Twitter Bootstrap stuff
//
var BSNames = {
// This isn't exhaustive. Need to think through what should go here. Should
// be exclusive.
bsClass: {'column': 'col', 'button': 'btn', 'btn-group': 'btn-group', 'label': 'label',
/** @jsx React.DOM */
var BootstrapModalMixin = function() {
var handlerProps =
['handleShow', 'handleShown', 'handleHide', 'handleHidden']
var bsModalEvents = {
handleShow: 'show.bs.modal'
, handleShown: 'shown.bs.modal'
, handleHide: 'hide.bs.modal'
@vonwao
vonwao / gist:2305906
Created April 4, 2012 21:40
kotlin extension function
fun List<Int>.swap(x : Int, y : Int) {
val tmp = this[x] // 'this' corresponds to the list
this[x] = this[y]
this[y] = tmp
}