Skip to content

Instantly share code, notes, and snippets.

View Terkwood's full-sized avatar
🦑

Terkwood Terkwood

🦑
  • Salesforce
  • Indiana, USA
  • 20:45 (UTC -04:00)
View GitHub Profile
@wheresalice
wheresalice / gist:883191
Created March 23, 2011 14:36
Arduino Redis client - pushes a message to a Redis list
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 10 }; // this is the ip within my lan
byte gateway[] = { 192, 168, 2, 254 }; // neccessary to get access to the internet via your router
byte subnet[] = { 255, 255, 255, 0 };
byte server[] = { 192, 168, 2, 50 }; // Redis Server
String list = "jobs";
String message = "hello world";
$ sudo vim /etc/systemd/system/docker-compose.service
[Unit]
Description=DockerCompose
After=docker.service
Requires=docker.service
[Service]
ExecStart=/opt/bin/docker-compose -f /home/core/docker-compose.yml up -d
@tomaka
tomaka / gist:623781c5af6ebbc5dcfe
Last active February 15, 2020 06:24
Gfx vs glium comparison table
Gfx and glium are Rust libraries that aim to provide a "rusty" abstraction over graphics programming APIs.
Both may look similar, and one of the questions that gets asked frequently on IRC is "what are the differences between gfx and glium?". Here is a comparison table:
| Gfx | Glium
-------------------------------------|-------------------------------------------------------------------------------------------------------------------|--------------------------------
URL | <https://github.com/gfx-rs/gfx-rs> | <https://github.com/tomaka/glium>
History | Papers since Oct 2013. Really started in June 2014. | Private/confidential from Feb 201
@kacole2
kacole2 / README.md
Last active April 25, 2020 11:51
EBS and EFS Volumes with Docker For AWS using REX-Ray

EBS and EFS Volumes with Docker For AWS using REX-Ray

This procedure will deploy Docker For AWS and go through the steps to build REX-Ray containers. This process will have some hiccups because Docker for AWS will provision resources in different availability zones (AZs). Multiple workers/agents will be spread across AZs (not regions) which means a potential host failure will trigger Swarm to restart containers that could spread across an AZ. If a container is restarted in a different AZ, the pre-emption mechanism for REX-Ray will not work because it no longer has access to the volume in the former AZ.

Deploy Docker for AWS.

Launch Stack

SSH into one of your Docker Manager Nodes

@dvanhorn
dvanhorn / linux_transcript.md
Last active January 25, 2021 22:17
problem running indirect function call via ffi

Here's a transcipt of something very similar that seems to result in an infinite loop on Linux. :(

dvanhorn@starburst:small $ cat f.c
int f() {
  return 42;
}

int (*ptr_to_f)() = f;
@peatiscoding
peatiscoding / build-tag-push.py
Created January 24, 2018 15:20
a script to convert your docker-compose.yml (version 2) with build node to image node; this script required DOCKERHUB_USER environment available.
#!/usr/bin/python
import os
import subprocess
import time
import yaml
import re
user_name = os.environ.get("DOCKERHUB_USER")
@RaasAhsan
RaasAhsan / Lambda.scala
Last active April 21, 2021 11:19
Type-level, untyped lambda calculus in Scala 3
object Lambda extends App {
sealed trait Term
sealed trait Var[I <: Index] extends Term
sealed trait App[T1 <: Term, T2 <: Term] extends Term
sealed trait Abs[T1 <: Term] extends Term
sealed trait If[T1 <: Term, T2 <: Term, T3 <: Term] extends Term
sealed trait Bool[T1 <: Boolean] extends Term
sealed trait Index
@SantoshSrinivas79
SantoshSrinivas79 / Inject javascript into HTML pages from console.md
Last active May 12, 2021 05:51
Inject javascript into HTML pages from console

#Inject javascript into HTML pages from console

An easy way to inject Javascripts into the current loaded dom using the developer console in chrome.

jQuery

var script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-1.7.2.min.js';
@rebeccaskinner
rebeccaskinner / ByteRing.hs
Created June 14, 2021 05:24
RingBuffer In A Byte String
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module ByteRing where
import Foreign.Ptr
import Foreign.C.Types
import Foreign.C.String
import Foreign.ForeignPtr
import System.Posix.Types
import System.Posix.Internals
@lightdiscord
lightdiscord / netlify.sh
Last active July 5, 2021 15:20
Rust and wasm and netlify
#!/usr/bin/env bash
set -e
cweb_version=0.6.16
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
chmod u+x cargo-web