Skip to content

Instantly share code, notes, and snippets.

View timgluz's full-sized avatar
😄

Timo Sulg timgluz

😄
View GitHub Profile
set -l data_status (curl -s https://iceportal.de/api1/rs/status)
set -l data_trip (curl -s https://iceportal.de/api1/rs/tripInfo/trip)
# next stop
echo  (echo $data_trip | jq -r '([ .trip.stops[] | select(.info.passed==false) ]
| first).station.name')
# train number
echo  (echo $data_trip | jq -r '"\(.trip.trainType)-\(.trip.vzn)"')
# speed
echo speed (echo $data_status | jq -r '"\(.speed) km/h"')
@palkan
palkan / 01_Readme.md
Last active April 30, 2023 00:03
Backport Rails 6 per-environment credentials

Backport Rails 6 per-environment credentials to Rails 5.2

Rails PR: rails/rails#33521

This patch makes it possible to use per-environment credentials (i.e., config/credentials/staging.yml.enc) in Rails 5.2.

Installation

  • Drop backport_rails_six_credentials.rb and backport_rails_six_credentials_command.rb somewhere, for example, into the lib/ folder
  • Add this line to config/application.rb:
@yogsototh
yogsototh / jobs.md
Last active October 10, 2016 10:41
ThreatGRID/Cisco Jobs

Intro

The Advanced Threat Security Team in Cisco's Security Business Group is building a global scale, multi-product security platform with an emphasis on Threat Intelligence and Incident Response support.

Our system runs as a distributed cluster in the cloud, and shrunk down to a single on-premises appliance. This keeps us focused on simple solutions, clear abstractions between services, composition of

@moul
moul / 1. script: scaleway + swarm + docker-machine.sh
Last active February 11, 2017 05:28
scaleway + swarm + docker-machine
#!/bin/sh
export SCALEWAY_ORGANIZATION=XXX
export SCALEWAY_TOKEN=XXX
export SWARM_TOKEN=XXX
docker-machine create -d scaleway --swarm --scaleway-name=swarm-manager --swarm-master --swarm-discovery=token://$SWARM_TOKEN swarm-manager
for node in 1 2 3; do docker-machine create -d scaleway --swarm --scaleway-name=swarm-node-$node --swarm-discovery=token://$SWARM_TOKEN swarm-node-$node; done

Git Cheat Sheet

Commands

Getting Started

git init

or

# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@cgrand
cgrand / foami.clj
Last active October 25, 2015 18:32
(ns foami.core
"FOreign Asynchronous Mechanism Interop"
(:require [clojure.core.async :as async]))
(def ^:private abandon (doto (async/chan) async/close!))
(def ^:private pending-writes (async/chan))
(defn put!
"Tries to put a val into chan, returns either: true if put succeeded, false if chan is
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@ptaoussanis
ptaoussanis / transducers.clj
Last active December 17, 2021 13:54
Quick recap/commentary: Clojure transducers
(comment ; Fun with transducers, v2
;; Still haven't found a brief + approachable overview of Clojure 1.7's new
;; transducers in the particular way I would have preferred myself - so here goes:
;;;; Definitions
;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as:
(fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation
;; (The `[]` arity is actually optional; it's only used when calling
;; `reduce` w/o an init-accumulator).
@john2x
john2x / 00_destructuring.md
Last active July 9, 2024 01:38
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences