- don't forget the
return
: it'sonsubmit="return someFunction()"
notonsubmit="someFunction()"
- if you are relying on an external javascript file to provide
someFunction()
, the function mustn't be wrapped in anything else. this means, no$(document).ready()
or the like. as a result, the external script needs to go *just before the closing `
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class PseudoMarkov(): | |
def __init__(self): | |
self.associations = {} | |
# pass it the corpus filepath | |
def gen(self, filepath): | |
sentences = [] |
- The
<image>
tag in SVG is used to include a bitmap image inside an SVG. - Safari (along with some other lesser-known browsers: Luakit, DWB, Rekonq, Konqueror) won't render
<image>
tags in an SVG unless the SVG is contained in a<object>
tag. - If you want your
<object>
to be a clickable link, you need to addobject { pointer-events: none}
to your CSS. - Unfortunately, this doesn't appear to always work. I had 2
<object>
s on one page that had similar CSS rules, and only one of them became clickable when I added theobject { pointer-events: none}
rule. There is a documented bug in webkit from 2011 that seems relevant to this problem, but it's a mystery to me. - The solution in my case was to convert the bitmap to a vector path. You can do this in Inkscape with
Path -> Trace bitmap
. As long as you're not trying to include photographs in the middle of your SVG (why on earth would you want to do that!!) then there probably isn't anything wrong with this approach.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PHRASES | |
Hello | |
Goodbye | |
Sorry | |
Thankyou | |
Yes | |
No | |
How are you? | |
Goodnight | |
Good morning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// an array of the src attributes of every audio element on the page (assumes sources are already set, obviously) | |
var sources = []; | |
$("audio").each (function(i) { | |
$(this).attr("id", i.toString()); | |
sources.push($(this).find("source").attr("src")); | |
}); | |
// call this function when the user clicks the play button | |
// $target is a jQuery object containing the "path" to your audio elements in the dom | |
function hack($target) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================================================ | |
VERY SHORT | |
============================================================ | |
íċ | reward | |
et | young | |
ís | skirt | |
ip | reason | |
du | purpose | |
an | strong |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind R source-file ~/.tmux.conf \; | |
#------------------------------------------------------------------------ | |
# Keys | |
#------------------------------------------------------------------------ | |
# replace the default prefix key (Ctrl-B) | |
unbind C-b | |
set -g prefix C-a | |
bind C-a send-prefix | |
bind a send-prefix |