Skip to content

Instantly share code, notes, and snippets.

View mainiak's full-sized avatar

Jakub Viták mainiak

View GitHub Profile
@joyrexus
joyrexus / README.md
Last active September 7, 2024 14:28
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...

@kerryrodden
kerryrodden / README.md
Last active January 18, 2021 11:05
Zoomable sunburst with updating data

I combined Mike Bostock's Zoomable Sunburst and Sunburst Partition examples, so that I could have both zooming and updating the underlying data (between count and size, in this case). A simple combination of the examples does not work; you have to edit the arcTween function used for updating the data, so that when it redraws the partition layout, it takes account of the current zoom level by adjusting the domain of the x scale.

Click on any arc to zoom in, and click on the center circle to zoom out. Use the Size/Count radio buttons to update the data.

@thegoleffect
thegoleffect / simple-rot13-stream.js
Last active August 29, 2015 14:02
Simple ROT13 Stream
var Stream = require('stream');
var Util = require('util');
/*
To Use:
var rot13 = new ROT13Stream();
streamOne.pipe(rot13).pipe(process.stdout); // takes readstream streamOne, modifies with rot13, pipes into stdout
*/
@plepe
plepe / gist:52ecc9f18efb32c68d18
Last active April 3, 2025 19:15
MDADM and LVM cheat sheet

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@davecheney
davecheney / bm_test.go
Last active May 10, 2024 18:30
Which is faster ? map[string]bool or map[string]struct{} ?
package bm
import (
"testing"
)
var mb = map[string]bool{
"alpha": true,
"beta": true,
"gamma": true,
#picaxe 08m2
' Odkaz https://gist.github.com/synaptiko/10754510
' Tabulka názvů proměnných, které lze v 08M2 použít:
' b0:b1 b2:b3 b4:b5 b6:b7 b8:b9 b10:b11 b12:b13 b14:b15 b16:b17 b18:b19 b20:b21 b22:b23 b24:b25 b26:b27
' w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13
' b* = 1 byte, tj. 256 různých hodnot
' w* = 2 byty, tj. 65 536 různých hodnot
' Kromě těchto dvou jde použít i bit* pro nastavení pouze 2 hodnot (true/false)
' Pozor bit0-bit7 se překrývá s b1. Stejně tak b1 a b2 se překrývá s w1. Analogicky je to i pro ostatní proměnné.
@peterknolle
peterknolle / AsyncReportController.cls
Created February 17, 2014 02:40
Asynchronous Reports with the Analytics API in Apex
public with sharing class AsyncReportController {
public List<SelectOption> availableReports { get; set; }
public Id reportId { get; set; }
public Id instanceId { get; set; }
public Boolean reportIsRunning { get; set; }
private transient Reports.ReportResults reportResults;
public AsyncReportController() {
availableReports = retrieveAvailableReports();
@lwe
lwe / hapi.js
Last active September 11, 2022 12:51
Server-sent-events with trial for hapi and one with a plain node.js http server.
var Hapi = require('hapi');
var stream = require('stream');
// Create a server
var server = Hapi.createServer('localhost', 8000);
// Add a route
server.route({
method: 'GET',
path: '/hello',
@rxaviers
rxaviers / gist:7360908
Last active May 13, 2025 14:01
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kerryrodden
kerryrodden / .block
Last active November 5, 2024 20:24
Sequences sunburst
license: apache-2.0