Skip to content

Instantly share code, notes, and snippets.

@foragerr
foragerr / announce_wins_discord_bot.py
Created November 23, 2021 18:10
Simple discord bot - posts to discord channel when mining pool wins block
import base64
import json
import logging
import time
import click
import requests
from discord_webhook import DiscordWebhook
GC_PROJECT_ID = "1019088744576"
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'com.bmuschko.tomcat-base'
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
@foragerr
foragerr / build.gradle
Created October 3, 2016 17:22
Check if env variable is set
task sysPropCheck << {
if (System.getenv('sysproptest'))
println 'sysproptest is set to ' + System.getenv('sysproptest')
else
println 'set sysproptest first!'
}
//Output:
// $ gradle -q sysPropCheck
// set sysproptest first!
@foragerr
foragerr / build.gradle
Created March 10, 2016 15:13
Gradle tasks to customize jars
apply plugin: 'java'
task gen(type: Jar){
baseName = 'genJar'
with jar
}
task gen2(type: Jar){
baseName = 'gen2Jar'
from sourceSets.main.output
@foragerr
foragerr / build.gradle
Created February 26, 2016 22:17
task generateThenCopy()
task generateThenCopy()<<{
newFile('codegenDestination/dynamically-generated.txt', 'dynamic file content')
zip{
from 'source'
from 'codegenDestination'
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Configure class="org.mortbay.jetty.Server">
<!-- =========================================================== -->
<!-- Initialize an mbean server -->
<!-- =========================================================== -->
<!-- Use the jdk 1.5 platformMBeanServer -->
<Call id="MBeanServer" class="java.lang.management.ManagementFactory" name="getPlatformMBeanServer"/>
<!-- =========================================================== -->
<!-- Initialize the Jetty MBean container -->
buildscript {
repositories{
maven{url 'http://repo1.maven.org/maven2/'}
}
dependencies {
classpath "org.hibernate:hibernate-gradle-plugin:5.0.7.Final"
}
}
apply plugin: 'org.hibernate.orm'
{
"swagger":"2.0",
"info":{
"description":"We Foo",
"version":"1.0",
"title":"Service REST API",
"termsOfService":"[email protected]",
"contact":{
"name":"Foundation team"
},
@foragerr
foragerr / build.gradle
Created January 27, 2016 14:06
Gradle build file to check depndencies
apply plugin:'java'
repositories{
jcenter()
}
dependencies {
compile("org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE") {
}
}
@foragerr
foragerr / dependencies.txt
Created January 27, 2016 13:46
All transitive dependencies for org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE
runtime - Runtime classpath for source set 'main'.
\--- org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE
+--- org.springframework.boot:spring-boot-loader-tools:1.3.2.RELEASE
| \--- org.springframework:spring-core:4.2.4.RELEASE
| \--- commons-logging:commons-logging:1.2
\--- io.spring.gradle:dependency-management-plugin:0.5.4.RELEASE