Skip to content

Instantly share code, notes, and snippets.

View taybin's full-sized avatar
🤷‍♂️
¯\_(ツ)_/¯

Taybin Rutkin taybin

🤷‍♂️
¯\_(ツ)_/¯
View GitHub Profile
@mramato
mramato / DrawHorizonPoint.js
Created July 14, 2015 01:45
A simple Cesium example of drawing a label at the horizon point.
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var ellipsoid = scene.globe.ellipsoid;
var entity = viewer.entities.add({
label : {
show : true,
outlineColor: Cesium.Color.BLACK,
verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
@terranware
terranware / eb-sns.json
Created May 12, 2015 20:19
Sample Elastic Beanstalk SNS Event
{
"Records": [
{
"EventSource": "aws:sns",
"EventVersion": "1.0",
"EventSubscriptionArn": "arn:aws:sns:us-east-1...ElasticBeanstalkNotifications-Environment-foo-app...",
"Sns": {
"Type": "Notification",
"MessageId": "111",
"TopicArn": "arn:aws:sns:us-east-1...ElasticBeanstalkNotifications-Environment-foo-app",
@keshavbahadoor
keshavbahadoor / sql_to_csv.py
Created May 11, 2017 15:14
Convert SQL Query to CSV File in Python
# Generic reader method
# Reads data, prints columns, and prints each row to file
def do_query_to_csv_file(cursor, sql, csv_file):
try:
cursor.execute(sql)
file_header = ''
f = open(file_dir + csv_file + '.csv', 'w')
columns = [column[0] for column in cursor.description]
for col in columns:
@esamattis
esamattis / systemdunit.py
Last active November 10, 2021 23:04
Install Systemd units using Ansible
"""
Install Systemd units using Ansible
Handles unit restarting and systemd daemon reloading when the unit changes.
Also stops the unit correctly when uninstalled
In your playbook put this file to library/systemdunit.py and make sure the
server has python-sh package installed
@fracasula
fracasula / context_cancel.go
Last active May 19, 2022 20:49
GoLang exiting from multiple go routines with context and wait group
package main
// Here's a simple example to show how to properly terminate multiple go routines by using a context.
// Thanks to the WaitGroup we'll be able to end all go routines gracefully before the main function ends.
import (
"context"
"fmt"
"math/rand"
"os"
import groovy.json.JsonSlurper
import org.sonatype.nexus.repository.storage.Asset
import org.sonatype.nexus.repository.storage.StorageFacet
def DOCKER_REPOSITORY_NAME = 'docker-hosted'
def dockerRepository = repository.repositoryManager.get(DOCKER_REPOSITORY_NAME)
def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName)
def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get()
try {
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
@caffo
caffo / GORILLA.BAS
Created October 31, 2011 03:24
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana
@gerbsen
gerbsen / ssh_agent_start.fish
Last active January 26, 2024 08:13 — forked from schaary/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
@ArtemGr
ArtemGr / makefile
Last active February 15, 2024 14:29
SPI helper for a PostgreSQL CHECK when using one-to-many with a jsonb.
all: spi.so
spi.so: spi.o makefile
g++ -shared -o spi.so spi.o
cp --remove-destination spi.so /var/lib/postgresql/spi.so
spi.o: spi.cc makefile
g++ -g -O2 -Wall -std=c++11 -fpic -c -o spi.o -I/usr/include/postgresql -I/usr/include/postgresql/9.4/server spi.cc
clean: