This file contains hidden or 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" | |
| ) | |
| func main() { | |
| var a,b []string | |
| a = []string{"a","b","d","e"} | |
This file contains hidden or 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
| docker run --rm --volume ${PWD}:/opt -it alpine /bin/sh | |
| # in container | |
| #export HTTPS_PROXY=http://10.0.4.1:3128/ | |
| #export HTTP_PROXY=http://10.0.4.1:3128/ | |
| cd /opt | |
| apk add git make gcc libc-dev | |
| git clone https://github.com/apangin/jattach.git && cd jattach/ | |
| make all |
This file contains hidden or 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
| #!/bin/bash | |
| if [ $# -ne 2 ]; then | |
| echo "USAGE: <username> <password>" | |
| exit 1 | |
| fi | |
| docker run -it eclipse-mosquitto /bin/sh -c "touch tmppwsave && mosquitto_passwd -b tmppwsave ${1} ${2} && cat tmppwsave && rm tmppwsave" |
This file contains hidden or 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
| #!/bin/sh | |
| min=0 | |
| step=1000 | |
| file=output.txt | |
| while true | |
| do | |
| curl -s https://api.pi.delivery/v1/pi\?start\=$min\&numberOfDigits\=$step | jq --join-output '.content' >> $file | |
| min=$(($min + $step)) |
This file contains hidden or 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
| // prime factorization for n | |
| func getPrimeFactorization(n int) ([]int) { | |
| var primefactors []int | |
| // check divisibility by 2,3 and all odd numbers up to n | |
| var divider = append([]int{2}, getOddNumbers(n)...) | |
| for _, i := range divider { | |
| for n % i == 0 { | |
| primefactors = append(primefactors, i) | |
| n = n / i |
This file contains hidden or 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
| ''' | |
| This script removes all comments from a specified jira issue | |
| Please provide Jira-Issue-Key/Id, Jira-URL, Username, PAssword in the variables below. | |
| ''' | |
| import sys | |
| import json | |
| import requests | |
| import urllib3 |
This file contains hidden or 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
| def dump(obj): | |
| for attr in dir(obj): | |
| print("obj.%s = %r" % (attr, getattr(obj, attr))) |
This file contains hidden or 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
| $customHeaders = [ | |
| "X-WR-CALNAME" => "foo", | |
| "X-WR-CALDESC" => "bar", | |
| ]; | |
| $cal->setCustomHeaders($customHeaders); |
This file contains hidden or 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
| import java.math.BigInteger; | |
| public class googol { | |
| public static void main(String[] args) { | |
| BigInteger bi = BigInteger.valueOf(10); | |
| bi = bi.pow(100); | |
| System.out.println(bi.toString()); | |
| } |
This file contains hidden or 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 tst; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import org.quartz.Job; | |
| import org.quartz.JobDataMap; | |
| import org.quartz.JobExecutionContext; | |
| import org.quartz.JobExecutionException; |