Skip to content

Instantly share code, notes, and snippets.

View mikko-kohtala's full-sized avatar

Mikko Kohtala mikko-kohtala

View GitHub Profile
jQuery(window).load(function() {
// käydään kaikki youtube-kikkareet läpi, ja luodaan thumbnail
jQuery('div.epgadget-externalvideo').each(function() {
jQuery(this).after('<div class="Thumb"></div>');
var iframe = jQuery(this).find('iframe');
var iframe_src = iframe.attr('src');
var youtube_video_id = iframe_src.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/).pop();
jQuery.ready({ DOM:true }, function($) {
$("li[class^='tab-'].unselected").each(function() {
if( $(this).find('span').length > 0 ) {
if( $(this).find('span > a').length == 0 ) {
$(this).addClass('HideElement');
}
};
});
$("li[id^='Tab-'].unselected").each(function() {
// Most of the time you can do data loading in react-router's onEnter/onLeave hooks, which support async operations. If you're using Redux or some other flux implementation, you can dispatch a loading() action, perform your data fetching, and then dispatch a loaded() action once the data's ready.
function fetchData(nextState, replace, done) {
store.dispatch(loading());
doAsyncThing().then(() => {
store.dispatch(loaded());
done();
});
}
@mikko-kohtala
mikko-kohtala / init.coffee
Last active January 27, 2016 12:33 — forked from Zequez/init.coffee
Comment out JSX code on Atom
# If you worked with React and JSX you probably noticed that you can't use JS comments when inside JSX sections
# Add this to your Atom init script
# Then add 'ctrl-cmd-/': 'comment-jsx' to your keymap.cson
# Then when you are on a JS/JSX file, just press cmd+ctrl+/ to use JSX-style comments that work with JSX elements
# Is not the most efficient way, but it's the cleanest and reliable one
# FORK UPDATE 27.1.2016:
# Overwriting "Toggle Comments" function:
# '.workspace .editor:not(.mini)':
# 'cmd-/': 'comment-jsx'
<?php
require_once('workflows.php');
$w = new Workflows();
// $query = ltrim($argv[1]);
// $parts = explode(' ', $query);
// echo "\n\n New Run \n\n";