Skip to content

Instantly share code, notes, and snippets.

View arehmandev's full-sized avatar
🎯
Focusing

Abdul Rehman arehmandev

🎯
Focusing
  • Freelance
  • London, UK
View GitHub Profile
@arehmandev
arehmandev / .drone.yml
Created January 28, 2018 12:09 — forked from d0x2f/.drone.yml
.drone.yml example
workspace:
base: /build
pipeline:
build-image:
image: docker
commands:
# Build development target, which includes xdebug.
# Tag with both api-build:<build_number> and api-build:latest.
@arehmandev
arehmandev / clear_build_history.groovy
Last active July 8, 2019 14:00 — forked from realityforge/Delete historic hobs and some workspaces
Kill all queued jenkins jobs and cancel any running jobs
Jenkins.instance.getView('All').getBuilds().each { it.delete() }
import hudson.model.*
def q = Jenkins.instance.queue
q.items.each {
if (it =~ /deploy-to/) {
q.cancel(it.task)
}
}
@arehmandev
arehmandev / grapeconfig.xml
Last active February 12, 2018 16:20
One that actually works
<?xml version="1.0" encoding="UTF-8"?>
<ivy-settings>
<settings defaultResolver="downloadGrapes" />
<resolvers>
<ibiblio name="ibiblio-maven2" m2compatible="true"/>
<ibiblio name="java-net-maven2" root="http://download.java.net/maven/2/" m2compatible="true" />
<ibiblio name="maven" root="http://mvnrepository.com/artifact/" m2compatible="true" />
<chain name="downloadGrapes">
<resolver ref="maven"/>
<resolver ref="ibiblio-maven2"/>
{
"$schema": "vscode://schemas/color-theme",
"comment": "Cold Snack, created by Evan Rowe.",
"author": "Evan Rowe",
"name": "Cold Snack Theme",
"tokenColors": [{
"settings": {
"background": "#002B36",
"foreground": "#93A1A1"
}
@arehmandev
arehmandev / removeSliceElement.go
Created April 25, 2018 13:32
Iteratively remove elements from slice
package main
import "fmt"
func main() {
slice := []string{"TEST1", "TEST2", "TEST3", "TEST4"}
fmt.Println("SLICE AT START", slice)
for i := len(slice) - 1; i >= 0; i-- {
class Example {
String name;
int ID;
static void main(String[] args) {
Example man = new Example()
man.getStudent()
println(man.name + " is " + man.ID)
@arehmandev
arehmandev / generate.sh
Created May 10, 2018 11:39
Running Helm and Tillerwith ssl on minikube
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
echo "Cleaning workspace"
ls -1 | grep -v generate.sh | xargs rm -rf
echo "Generating CA"
openssl genrsa -out ./ca.key.pem 4096
openssl req -key ca.key.pem -new -x509 -days 7300 -sha256 -out ca.cert.pem
@arehmandev
arehmandev / structs_interface.go
Created May 24, 2018 02:40 — forked from josephspurrier/structs_interface.go
Golang - Understand Structs and Interfaces
// Also available at: https://play.golang.org/p/yTTpB5gB6C
package main
import (
"fmt"
)
// *****************************************************************************
// Example 1 - Struct vs Struct with Embedded Type
type Func func(key string) (interface{}, error)
type result struct {
value interface{}
err error
}
type entry struct {
res result
ready chan struct{}