Skip to content

Instantly share code, notes, and snippets.

Avatar

Kai Rollmann Kadrian

View GitHub Profile
@Kadrian
Kadrian / buy-coins.js
Last active Sep 13, 2017
Buy BTC / ETH / XRP automatically
View buy-coins.js
// -----------
//
// ## How to use:
//
// 1) Install node 8
//
// 2) Install dependencies:
// `npm install crypto request`
//
// 3) Get a Bitstamp account, API key and tweak viariables below
@Kadrian
Kadrian / material-green.css
Created Mar 24, 2017
Copy of material.css to host it where https is working
View material-green.css
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjQ0MzM2IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtMmgydjJ6bTAtNGgtMlY3aDJ2NnoiLz48L3N2Zz4=)}[src$="yellow.png
View numberToThreeDigitArray.js
// Trying to find the best solution to the following problem:
//
// Display a large number with a small space in between steps of thousand.
// Thus => Convert a number to an array of max. three digits
//
// E.g.
// Input: 10 Output: [10]
// Input: 1234 Output: [1, 234]
// Input: 24521280 Output: [23, 521, 280]
@Kadrian
Kadrian / actions.js
Created Jul 15, 2016
Redux async actions example
View actions.js
const defaultError = (type, error) => (
{
type,
error: true,
payload: {
message: error
},
}
);
@Kadrian
Kadrian / get-dht11-data.py
Last active Aug 4, 2019
Get Temperature and Humidity from DHT11 module with Raspberry Pi and RPi.GPIO
View get-dht11-data.py
import RPi.GPIO as GPIO
import time
import traceback
# Helper
def bin2dec(string_num):
return str(int(string_num, 2))
def setup_gpio(port):
GPIO.setmode(GPIO.BCM)
@Kadrian
Kadrian / gist:83f8aacac8c8e118ce1c
Created Jan 9, 2015
Render the author's image
View gist:83f8aacac8c8e118ce1c
<% if not no_author_img %>
<img class="author" src="<%= author['author.image'].views['small'].url %>">
<% end %>
@Kadrian
Kadrian / scss-analysis.py
Last active Aug 29, 2015
SCSS Statistics Analysis
View scss-analysis.py
import sys
def analyzeFile(filename):
f = open(filename)
selectors, rules = [], []
for w in f.readlines():
w = w.strip()
if len(w) > 2:
if (w.startswith('.') or
w.startswith('/') or
You can’t perform that action at this time.