Skip to content

Instantly share code, notes, and snippets.

View jarkkosyrjala's full-sized avatar

Jarkko Syrjälä jarkkosyrjala

View GitHub Profile
@jarkkosyrjala
jarkkosyrjala / Browser.tsx
Created October 15, 2020 20:00
Render static content as HTML and get the content from server side rendered HTML back as props before hydration
import * as React from 'react'
import DynamicAppWithStaticSections, {
DynamicAppWithStaticSectionsProps,
DynamicAppWithStaticSectionsHydrationProps,
} from './DynamicAppWithStaticSections'
import { hydrate } from 'react-dom'
interface AppWindow extends Window {
__APP__: DynamicAppWithStaticSectionsHydrationProps
}
declare const window: AppWindow
@jarkkosyrjala
jarkkosyrjala / Enabler.d.ts
Created September 3, 2015 08:55
TypeScript Type Definitions for Building Ads with DoubleClick Studio HTML5 SDK.
// Type definitions for building ads with DoubleClick Studio HTML5 SDK.
// Project: https://www.doubleclickbygoogle.com/solutions/digital-marketing/creative-solutions/
// Definitions by: Jarkko Syrjälä <https://github.com/jarkkosyrjala>
// SDK javascript documentation https://www.google.com/doubleclick/studio/docs/sdk/html5/en/namespace_studio.html
declare module studio {
export class Enabler {
constructor(useSingletonGetter:number);
static getInstance():studio.Enabler;
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite