Skip to content

Instantly share code, notes, and snippets.

@egraether
egraether / LICENSE.txt
Created May 24, 2011 15:28 — forked from 140bytes/LICENSE.txt
Pie Chart Timer
Copyright (c) 2011 Eberhard Gräther, http://egraether.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
anonymous
anonymous / index.html
Created December 12, 2016 10:10
Classwork 5 // source https://jsbin.com/qulaqo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Classwork 5</title>
</head>
<body>
<span id="abTest">Enter Text </span>
<input id="getName" value="name please" onkeyup="updateName()"></input><br>
anonymous
anonymous / index.html
Created January 2, 2017 17:27
JS Bin // source https://jsbin.com/haziyef
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
html {
background: url(http://i.imgur.com/Rksbpdu.jpg) no-repeat center fixed;
background-size: 100% 100%;
@barakplasma
barakplasma / jsbin.zobogoj.css
Last active January 10, 2017 08:26 — forked from anonymous/index.html
JS Bin todo list homework// source https://jsbin.com/zobogoj
button {
color: white;
background: blue;
}
button:hover {
background: lightblue;
}
html{
font-family: Helvetica;
//Test detectWixSite.js to make sure changes don't break it
const chai = require('chai'),
chaihttp = require('chai-http');
const should = chai.should();
const querystring = require('querystring')
const key = require('./secrets')
const motionAiEndpoint = 'https://api.motion.ai/1.0/messageBot'
var n
//var melody = [ 0, -1, -3, -5,-7,-8,-10,-12 ] // reverse DoSiLaSoFaMiReDo
//var melody = [ 0, 2, 4, 5,7,9,11,12 ] //DoReMiFaSoLaSi
var melody =[
34, 4, n, 4, n, 0, 4, n, 7, n, n, n, -5, n, n, n,
0,n,n,-5,n,n,-8,n,n,-3,n,-1,n,-2,-3,n,-5,4,n,7,9,n,5,7,n,4,n,0,2,-1,n,n,n,
0,n,n,-5,n,n,-8,n,n,-3,n,-1,n,-2,-3,n,-5,4,n,7,9,n,5,7,n,4,n,0,2,-1,n,n,n,
n,-5,7,6,5,3,n,4,n,-5,-3,0,0,-3,0,2,n,n,n,7,6,5,3,n,4,n,n,12,n,12,12,n,n,n,n,
n,n,7,6,5,3,n,4,n,-5,-3,0,n,-3,0,2,n,n,3,n,n,2,n,n,0,n,n,-5,-5,n,-12,n,
0,0,n,0,n,0,2,n,4,0,n,-3,-5,n,n,n,
@LeoAref
LeoAref / renameKeyName.js
Created May 19, 2017 05:49
Immutable object key renaming using Lodash
export function renameKeyName(obj, oldName, newName) {
const clone = cloneDeep(obj);
const keyVal = clone[oldName];
delete clone[oldName];
clone[newName] = keyVal;
return clone;
}
package main
import (
"fmt"
)
func main() {
fmt.Println(Divisors_simple(10)) // should equal 4
fmt.Println(Divisors_pointers(10)) // should equal 4
fmt.Println(Divisors_channels(10)) // should equal 4
@Maddosaurus
Maddosaurus / telegraf.conf
Created February 25, 2017 12:18
Telegraf speedtest-cli exec
#### WARNING ####
# POC SAMPLE CONFIG! NEVER USE IN PROD!
#
# Telegraf Configuration
#
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
#
@JohannesBuchner
JohannesBuchner / benchmark.sh
Last active January 1, 2021 07:54
awk solutions for simple groupby in https://h2oai.github.io/db-benchmark/
# columns: id1,id2,id3,id4,id5,id6,v1,v2,v3
f=G1_1e7_1e2_0_0.csv
awk="time mawk"
# groupby simple
$awk -F, 'NR>1 { a[$1] += $7 } END {for (i in a) print i, a[i]}' $f >/dev/null
$awk -F, 'NR>1 { a[$1,$2] += $7 } END { for (comb in a) { split(comb,sep,SUBSEP); print sep[1], sep[2], a[sep[1],sep[2]]; }}' $f >/dev/null
$awk -F, 'NR>1 { a[$3] += $7; n[$3]++; b[$3] += $9; } END {for (i in a) print i, a[i], b[i]/n[i];}' $f >/dev/null
$awk -F, 'NR>1 { a[$4] += $7; n[$4]++; b[$4] += $8; } END {for (i in a) print i, a[i]/n[i], b[i]/n[i];}' $f >/dev/null