Skip to content

Instantly share code, notes, and snippets.

View johnkawakami's full-sized avatar

John Kawakami johnkawakami

View GitHub Profile
@johnkawakami
johnkawakami / uglyfunction.js
Created March 22, 2018 07:45
React function that shouldn't really be written like this
const TitleList = (props) =>
(
<ul key="tlul">
{
props.list ? (
props.list.map( (item) => (
<li key={item.url}
className='list__item'
onClick={ (evt) => { props.openPreview(item.url); } }>
{item.title}
@johnkawakami
johnkawakami / gist:e94bd21d774c482a86e4
Created June 4, 2015 20:04
jQuery, lodash, senators, simple example
<html>
<head>
<script src="lodash.js"></script>
<script src="jquery-2.1.4.js"></script>
</head>
<body>
<p>
California's delegation: <span id="cal"></span>
</p>
<p>
@johnkawakami
johnkawakami / main.c
Created August 31, 2012 11:18
Two examples of how to use GArray
#include <glib.h>
#include <stdio.h>
int main( int argc, char *argv[] )
{
GString *s;
GString gs;
GArray *a;
int i;