Skip to content

Instantly share code, notes, and snippets.

@kf4x
kf4x / create_swarm_cluster.sh
Created July 27, 2023 21:10 — forked from alexei-led/create_swarm_cluster.sh
Deploy Docker Compose (v3) to Swarm (mode) Cluster
#!/bin/bash
# vars
[ -z "$NUM_WORKERS" ] && NUM_WORKERS=3
# init swarm (need for service command); if not created
docker node ls 2> /dev/null | grep "Leader"
if [ $? -ne 0 ]; then
docker swarm init > /dev/null 2>&1
fi
@kf4x
kf4x / README.md
Last active February 1, 2021 16:07
Getting started

Wallet

  1. create account https://metamask.io/
  2. Buy Etherium (coinbase.com, cex.io) will need your ID verified
  3. Transfer to metamask account (Etherium wallet address
  4. Connect wallet to pool a. If using phone, open the browser in MetaMask and head to https://yearn.finance/vaults b. If using computer, https://yearn.finance/vaults
  5. Select Etherium and deposit amount into pool to begin making money
@kf4x
kf4x / building.py
Last active July 11, 2019 19:53
A little example of beginning to think about approaching a elevator in building problem.
class Building(object):
"""Building
has many Elevators
has many Floors
"""
def __init__(self, floors, elevators):
super(Building, self).__init__()
self.total_floors = floors

Keybase proof

I hereby claim:

  • I am javierchavez on github.
  • I am javierc (https://keybase.io/javierc) on keybase.
  • I have a public key whose fingerprint is 46AA 8AC6 CF9D A286 8D79 7B69 0B0E E903 16E2 2091

To claim this, I am signing this object:

@kf4x
kf4x / ex.rb
Last active November 2, 2015 08:05
def create
# when a create occurs somthing like this is sent to server with a POST request.....
{
"utf8"=>"✓",
"authenticity_token"=>"some/crazy/token",
"transaction"=>{"name"=>"chik-fil-a",
"category_id"=>"1",
"amount"=>"1.1"},
"commit"=>"Create Transaction"
}
@kf4x
kf4x / HWTemplate.tex
Last active August 29, 2015 14:15 — forked from dcernst/HWTemplate.tex
% --------------------------------------------------------------
% This is all preamble stuff that you don't have to worry about.
% Head down to where it says "Start here"
% --------------------------------------------------------------
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
@kf4x
kf4x / secrets
Created May 16, 2014 22:02
Google Urls
tranit api.
http://maps.googleapis.com/maps/api/directions/json?origin=35.080935,-106.623872&destination=35.079812,-106.604904&sensor=false&departure_time=1400254800&mode=transit
@kf4x
kf4x / atest.py
Last active August 29, 2015 13:58
Load data file as json
import json
# open file
json_file = open("data.json")
# load json from file
json_data = json.load(json_file)
# total marks
print len(json_data['placemarks'])
@kf4x
kf4x / master.ucf
Created November 11, 2013 00:57
UCF DIGILENT nexys 3
## This file is a general .ucf for Nexys3 rev B board
## To use it in a project:
## - remove or comment the lines corresponding to unused pins
## - rename the used signals according to the project
## Clock signal
#NET "clk" LOC = "V10" | IOSTANDARD = "LVCMOS33"; #Bank = 2, pin name = IO_L30N_GCLK0_USERCCLK, Sch name = GCLK
#Net "clk" TNM_NET = sys_clk_pin;
#TIMESPEC TS_sys_clk_pin = PERIOD sys_clk_pin 100000 kHz;
@kf4x
kf4x / gist:7131112
Created October 24, 2013 03:57
convert HEX to RGB
RRGGBB
R(1)R(2)
R(1)*16 + R(2)