This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: dataday | |
# http://ruby-doc.org/stdlib-2.0.0/libdoc/json/rdoc/JSON.html | |
require 'json' | |
# https://github.com/sporkmonger/addressable | |
require 'addressable/uri' | |
# http://www.rubydoc.info/gems/activesupport/5.0.0 | |
require 'active_support' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... | |
def make_request(url, secure = false) | |
url = url(url) # Make Addressable | |
opts = secure ? { verify_ssl: OpenSSL::SSL::VERIFY_PEER } : {} | |
opts.merge!(content_type: @config[:content_type], user_agent: @config[:agent]) | |
cert = @config[:cert_path] || '' | |
pass = @config[:cert_password] || '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Author: dataday (2015) | |
# | |
# Description: influxdb updates for new users and databases | |
# | |
# To remove influx data and meta | |
# rm -rf /var/opt/influxdb/meta/*; rm -rf /var/opt/influxdb/data/*; rm -rf /var/opt/influxdb/wal/* | |
# service influxdb restart | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: clean prepare rpmbuild | |
# | |
# Author: dataday | |
# | |
# Description: | |
# | |
# Provides common make script functions for | |
# building RPM versioned packages | |
# | |
# Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
nunjucksRender: { | |
manageEnv: function(env) { | |
const utils = new Utils(); | |
env.addFilter('split', utils.splitFilter); | |
env.addFilter('get', utils.getFilter); | |
env.addFilter('is', utils.isFilter); | |
env.addFilter('classify', utils.classifyFilter); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hexToRGBA = (hex: string, opacity: number = 1) => { | |
hex = hex.replace('#', '') | |
let r = parseInt(hex.substring(0, 2), 16) | |
let g = parseInt(hex.substring(2, 4), 16) | |
let b = parseInt(hex.substring(4, 6), 16) | |
return 'rgba(' + r + ',' + g + ',' + b + ',' + opacity + ')' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* # icon.js | |
* | |
* Component | |
* | |
* @author dataday | |
* | |
* @flow | |
*/ | |
'use strict' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'mysql2' | |
require 'base64' | |
begin | |
connection = { | |
host: 'localhost', | |
username: 'username', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from collections import OrderedDict | |
# re.MULTILINE | |
line_pattern = re.compile('^([\w\W]+)\.([\w\d]+)\s(\d+)b$') | |
selected_file_types = { | |
'music': ['mp3', 'aac', 'flac'], | |
'images' : ['jpg', 'bmp', 'gif'], | |
'movies' : ['mp4', 'avi', 'mkv'], | |
'other' : ['7z', 'txt', 'zip', 'exe'] |