- Add the
build_pull_request.sh
to the root of your git repository; - Add the
android.yml
file to.github/workflows/
; - Make
build_pull_request.sh
executable using:chmod +x build_pull_request.sh
; - Commit your code and push the changes
# MIT License
def r = new Random() | |
def num = r.nextInt(12000000).toString() | |
println num | |
println num.bytes.length | |
println encodeNumber(num, getEncoder()) | |
println encodeNumber(num, getEncoder()).bytes.length | |
def getEncoder(){ | |
['1','2','3','4','5','6','7','8','9','0','-','=','!','@','#','$','%','^','&','*','(',')','_', | |
'+','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', |
# Create a RPi with consul running on it | |
docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.3 swl-consul | |
docker $(docker-machine config swl-consul) run -d --restart=always -p 8500:8500 -h consul nimblestratus/rpi-consul -server -bootstrap | |
# Create a RPi swarm with consul discovery | |
docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.4 --swarm --swarm-master --swarm-discovery="consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-store=consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-advertise=eth0:0" swl-demo0 | |
docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.5 --swarm --swarm-discovery="consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-store=consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-advertise=eth0:0" --engine-label "storage=ssd" swl-demo1 | |
# Connect to the RPi swarm | |
eval $(docker-machine env --swarm swl-demo0) |
#!/usr/bin/php5 | |
<?php | |
/* | |
* Speedtest.net linux terminal client. | |
* This is free and open source software by Alex based on a script from Janhouse | |
* Script uses curl, executes ifconfig commands in shell and writes temporary files in temp_down folder. Make sure you have everything set up before using it. | |
*/ | |
header("content-type: text/plain"); | |
/* * * Configuration * * */ | |
$iface="eth0"; |
#ifndef __dbg_h__ | |
#define __dbg_h__ | |
#include <stdio.h> | |
#include <errno.h> | |
#include <string.h> | |
#ifdef NDEBUG | |
#define debug(M, ...) | |
#else |
import java.nio.channels.FileLock | |
final file = new RandomAccessFile(new File("foo.lock"), "rw") | |
println "<Entering in critical section>" | |
try { | |
/* | |
* wait to acquire a lock | |
*/ | |
def secs = 0 | |
FileLock lock |
apply plugin: 'maven-publish' | |
apply plugin: 'signing' | |
task androidSourcesJar(type: Jar) { | |
archiveClassifier.set('sources') | |
if (project.plugins.findPlugin("com.android.library")) { | |
from android.sourceSets.main.java.srcDirs | |
from android.sourceSets.main.kotlin.srcDirs | |
} else { | |
from sourceSets.main.java.srcDirs |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
class MyCustomRadialGauge extends StatefulWidget { | |
@override | |
_MyCustomRadialGaugeState createState() => _MyCustomRadialGaugeState(); | |
} | |
class _MyCustomRadialGaugeState extends State<MyCustomRadialGauge> |
@Grapes([ | |
@Grab('redis.clients:jedis:1.5.1'), | |
@GrabConfig(systemClassLoader=true) | |
]) | |
import redis.clients.jedis.* | |
performTest("unencoded", null) {n, e-> | |
n.toString() | |
} |
from django.contrib.sessions.backends.base import SessionBase, CreateError | |
from django.conf import settings | |
from django.utils.encoding import force_unicode | |
import redis | |
class SessionStore(SessionBase): | |
""" Redis store for sessions""" | |
def __init__(self, session_key=None): | |
self.redis = redis.Redis( |