This file contains 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
//!! Processing provides [] from input tools/closure-compiler/externs/browser/w3c_eventsource.js | |
//!! Processing provides [goog.labs.userAgent.engine] from input closure-library/closure/goog/labs/useragent/engine.js | |
//!! Processing provides [goog.html.TrustedResourceUrl] from input closure-library/closure/goog/html/trustedresourceurl.js | |
//!! Processing provides [goog.events.EventId] from input closure-library/closure/goog/events/eventid.js | |
//!! Processing provides [goog.html.SafeUrl] from input closure-library/closure/goog/html/safeurl.js | |
//!! Processing provides [] from input tools/closure-compiler/externs/browser/intl.js | |
//!! Processing provides [] from input tools/closure-compiler/externs/browser/w3c_pointerlock.js | |
//!! Processing provides [goog.dom.vendor] from input closure-library/closure/goog/dom/vendor.js | |
//!! Processing provides [] from input tools/closure-compiler/externs/browser/w3c_vibration.js | |
//!! Processing provides [] from input tools/closure-compiler/externs/browser/webkit_notifications.js |
This file contains 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
func (p *XImpl) Listen(_ *empty.Empty, rec services.X_ListenServer) error { | |
c := make(chan *services.X, 16) | |
p.add(c) | |
defer p.remove(c) | |
ctx := rec.Context() | |
for { | |
select { | |
case v := <-c: | |
if err := rec.Send(v); err != nil { | |
return err |
This file contains 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
# Python3 code below | |
import os | |
import base64 | |
import json | |
from Crypto.Cipher import AES | |
from phpserialize import loads | |
import hashlib | |
import hmac | |
This file contains 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
package eu.pawelsz.apache.beam; | |
import org.apache.beam.sdk.coders.CannotProvideCoderException; | |
import org.apache.beam.sdk.coders.Coder; | |
import org.apache.beam.sdk.coders.CoderRegistry; | |
import org.apache.beam.sdk.coders.KvCoder; | |
import org.apache.beam.sdk.transforms.*; | |
import org.apache.beam.sdk.values.KV; | |
import org.apache.beam.sdk.values.PCollection; |
This file contains 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
package pl.pawelsz.apache.beam; | |
import org.apache.beam.sdk.transforms.SimpleFunction; | |
import org.apache.beam.sdk.values.KV; | |
public class Only { | |
public static class Values<TK, TI, TO> extends SimpleFunction<KV<TK, TI>, KV<TK, TO>> { | |
private final SimpleFunction<TI, TO> map; |
This file contains 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
# pip install pyqrcode | |
# pip install pypng | |
import pyqrcode | |
for i in range(1000,1500): | |
number = pyqrcode.create(i) | |
number.png('dest/{}.png'.format(destdir,i)) |
This file contains 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
// http://dev.pawelsz.eu/2016/04/go-imagick-image-croping-after-rotation.html | |
// | |
package main | |
import ( | |
"gopkg.in/gographics/imagick.v2/imagick" | |
"log" | |
"math" | |
) |
This file contains 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
version: '2' | |
services: | |
rmq: | |
container_name: rm-rabbitmq | |
image: rabbitmq:3.6 | |
networks: | |
- rmnet | |
data: |
This file contains 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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func CalcNewSize(w, h uint, maxW, maxH int32) (uint, uint) { | |
haveF := float64(w) / float64(h) | |
wantF := float64(maxW) / float64(maxH) |
This file contains 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
package main | |
import ( | |
"fmt" | |
"path" | |
) | |
type StringGenerator interface { | |
Next() bool | |
Get() string |