Skip to content

Instantly share code, notes, and snippets.

View jarkkosyrjala's full-sized avatar

Jarkko Syrjälä jarkkosyrjala

View GitHub Profile
@jarkkosyrjala
jarkkosyrjala / enable_name_property_for_children_in_container.js
Last active December 21, 2015 13:59
Enabling instance names (.name property) in JavaScript library exported from Flash Professional / Toolkit for CreateJS.
var someContainer=new lib.SomeContainer();
for(var childName in someContainer){
if(someContainer[childName] instanceof createjs.DisplayObject) {
someContainer[childName].name=childName;
console.log(childName+" now has a name!!");
}
}
@jarkkosyrjala
jarkkosyrjala / html_game_template.html
Last active December 21, 2015 22:28
Simple html template with viewport and css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="chrome=1, IE=edge">
<title>Title</title>
<style type="text/css">
html, body {
package;
import flash.Lib;
import flash.Vector;
import flash.display.Sprite;
class Main extends Sprite {
package geom {
import flash.events.Event;
import flash.geom.Point;
import flash.utils.getTimer;
/**
* Simple class for orbiting a point
* @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Point.html
*
* Also has methods for updating value using ENTER_FRAME event
@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;
@jarkkosyrjala
jarkkosyrjala / Browser.tsx
Created October 15, 2020 19:58
Render static content as HTML and on hydration get the content from server side rendered HTML back as props
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 / 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 / fi-nordpool-apex-chart-card-configuration.yaml
Created September 18, 2022 20:36
Home Assistant Card Configuration displaying Today's and
type: custom:apexcharts-card
header:
show: true
title: ⚡️ Hinnat tänään ja huomenna
show_states: true
colorize_states: true
graph_span: 24h
all_series_config:
stroke_width: 2
type: column
type: custom:apexcharts-card
header:
show: true
title: ⚡️ Hinnat tänään ja huomenna
show_states: true
colorize_states: true
graph_span: 24h
all_series_config:
stroke_width: 2
type: column