Skip to content

Instantly share code, notes, and snippets.

@DanielRapp
DanielRapp / index.html
Created January 14, 2022 22:55
minimal wasm
<html>
<body>
<script type="module">
const res = await fetch('main.wasm');
const buffer = await res.arrayBuffer();
const compiled = await WebAssembly.compile(buffer);
const memory = new WebAssembly.Memory({ initial: 256, maximum: 256 });
const prog = new WebAssembly.Instance(compiled, {env: { memory }});
const wasm_func = prog.exports.double;
,>,[-<+>]++++++++++++++++++++++++++++++++++++++++++++++++[-<->]<.
(function($){
$.fn.foo = function(options) {
options = $.extend({}, $.fn.foo.defaults, options);
return this.each(function() {
// Gör saker här
});
};
$.fn.foo.defaults = {
'foo': 'bar'
};
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAgAElEQVR4AXR922sT2/t+4qHWtjmnFGqQIGErhIoQsBS9GFAqQSp6MRe7pRIUAioFyy5V7+bKWrppIVghoATFejEXSqkUS4VcKMVCQBSCboIUqZRS0Wr/gfV7nnWYTP18fxdhJmvWadas9a738LzvCgghAuJwJOaK33HbHT0o/yPNte29Ys1qFVWxb3DucMztWzkoHKcFz4Mmj8iJ/W/eRGLZWavDrdsdzo/FsPfsZy0i7x2xZ2zzQzvvSyJzgNdKwWlN2dn4hVMXQib/2NKH9nK5uP/+3U+JbzsiodODAuV5X7WcfUcvHA05VnXfVt3pWFoKyDorIh2VeRv5Ztvoo1O19olX0/F//nWSpg1zdd31g2Ld5rvuZdqdk4dMewGTx1xzQuw395OTj1R/a800Prs4M6P6sH0zalWdVpOf1/vfQrLu7YsnVB6kCWHtOzX5Wdbl1N0WR8h3bI4r8jhrqOfboUShUmkdfWjHe07PxVCfzHP+9unY+TeH+T/guvbe/GLmQNZxW+ouvk/KPXi652tM5IcwHi6/V4D1N0ojB45/GGs/dOwy+uPIMeWzchHvcnowNtTIyPH7/uio90343PymujbbV2VZEThxUb+v7zn7cfTRZKh/aqm9JnIYs1ybLHtld32Or+2SYB9R33srKscA39oWWdnnCwLlHLslNW0fXCiX2zDXZH2x2HIkW7/eIesuZQ7kyrX91n//JIu5ovedNtEHPr/eudWRnnGijYY4IEriwNjSWPtANZfEPN5zWHyU4yfrwdzitVhUdeQX8wduLZ+V81cOgLu1pRrUL7zuWyhCXAkFqoVdH72+koqnrq7HWen0KCYbrk7pXbjiWK2nvzYbzuQb4bRYaxVfJ2K5GgYNk9tx1UdjmRuXMAFOCDlxopW1aDVr7+oH8ux5Fa7Ldpg/m8221DB
@DanielRapp
DanielRapp / gist:896712
Created March 31, 2011 16:36
ProgB v13
using System;
class MainClass
{
// Write the contents of the array 'arr' and separate each value with 'separator'
static void WriteLineArray(int[] arr, string separator)
{
for (int i = 0; i < arr.Length; i++) {
if (i == arr.Length - 1) separator = "";
Console.Write(arr[i] + separator);
using System;
class MainClass
{
// Write the contents of the array 'arr' and separate each value with 'separator'
static void WriteLineArray(int[] arr, string separator)
{
for (int i = 0; i < arr.Length; i++) {
if (i == arr.Length - 1) separator = "";
Console.Write(arr[i] + separator);
<script src="http://www.imdbapi.com/?t=True%20Grit&y=1969&callback=minfunktion"></script>
@DanielRapp
DanielRapp / gist:868283
Created March 13, 2011 17:42
homework v11
using System;
class MainClass
{
static TimeSpan getTimeSec() {
Console.Write("Timme: ");
int hour = Int32.Parse(Console.ReadLine());
Console.Write("Minut: ");
int min = Int32.Parse(Console.ReadLine());
@DanielRapp
DanielRapp / Rot180
Created March 5, 2011 03:21
A bookmarklet that rotates the document 180 degrees.
javascript:(function(){document.body.style.webkitTransform=document.body.style.MozTransform="rotate(180deg)"}())
@DanielRapp
DanielRapp / RevScroll
Created March 5, 2011 03:19
A bookmarklet that reverses the direction of scrolling
javascript:d=document;b=d.body;s=b.scrollTop;d.onscroll=function(){n=s-(b.scrollTop-s)*2;scroll(0,n<1?1:n);s=b.scrollTop}