Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Schwartz ksmarty

View GitHub Profile
View .drone.yml
---
kind: pipeline
name: production
steps:
- name: now
image: one000mph/drone-now
environment:
NOW_TOKEN:
from_secret: now_token
View droneRunner.txt
$ docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DRONE_RPC_PROTO=http \
-e DRONE_RPC_HOST= \
-e DRONE_RPC_SECRET= \
-e DRONE_RUNNER_CAPACITY=2 \
-e DRONE_RUNNER_NAME=${HOSTNAME} \
-p 3000:3000 \
--restart always \
--name runner \
View droneServer.txt
docker run \
--volume=/var/lib/drone:/data \
--env=DRONE_GITEA_SERVER= \
--env=DRONE_GITEA_CLIENT_ID= \
--env=DRONE_GITEA_CLIENT_SECRET= \
--env=DRONE_RPC_SECRET= \
--env=DRONE_SERVER_HOST= \
--env=DRONE_SERVER_PROTO=http \
--publish=80:80 \
--publish=443:443 \
View .drone.yml
---
kind: pipeline
name: default
steps:
- name: now
image: one000mph/drone-now # Use one000mph's version as lucaperret's is outdated
environment:
NOW_TOKEN:
from_secret: now_token # Refers to a secret in your drone repo titled "NOW_TOKEN"
@ksmarty
ksmarty / tasks.json
Last active Jan 9, 2020
Setup c tasks
View tasks.json
// Copy this file to the .vscode directory in your workspace
{
"version": "2.0.0",
"tasks": [
{
"label": "Build with Clang",
"type": "shell",
"command": "clang",
"args": [
"${file}",
View Java Snippets.txt
Turnary Operator
----------------------------------------------
a ? b : c
if a is true, return b, else return c
a is an expression, b & c are values
View Javascript File Handling.js
// Text File
fetch('file.txt')
.then(response => response.text())
.then(text => console.log(text))
// ----------------------------------------------------------------------------
// JSON File