Skip to content

Instantly share code, notes, and snippets.

View orangecms's full-sized avatar
🐢
Hack the planet!

Daniel Maslowski orangecms

🐢
Hack the planet!
View GitHub Profile
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2
owGtkr2LE0EYxvf8IgrCBawlDFiIIczsfOxOxFq9Qjw8T64xNx/vJOPd7cbdTTQc
EUtLsVCxFP8AG/0nFEEbhcNGENFOLLQQdTYEOUGsnGp49/c8+7zvO7cP740azbcX
Vhm8fFAsPPuoo4tfu9+2kc7tBHW3kdn0kFX1LVNbgLpoAyZaldDxeSvLLXSulK05
00ZjKEqfZ4HCnbRDUjRt13ythk0LZdXb8Lb+SgjBznKeEEeVtkZwTFILQqWYMieE
JZIRLDV1nGpJbOwMMYpocI6mhiQ8BqzCD53P+lAMC19HRJTZRMgYGKEy1iROsLQC
a2Etp1xQJnjwVUkchIO8rP5oBs2S9mbx/sL/59yjmR01NpbYGR7KTpOEMu2UTAVJ
ZPAlsgZLKOaDzwsVmjVbZT3VUB57A7v20vfVYKT/Iakmw7p2DXRvru5pn9kwwd2b
@orangecms
orangecms / gpg-edit.sh
Last active February 22, 2016 11:10
simple script to edit gpg-encrypted files :)
#!/bin/bash
if [ -n "$1" ]
then
PGP_KEY_ID=CED8B95F
ENCRYPTED_FILE=${1}
TEMP_FILE=/tmp/gpg-edit-temp # TODO: test if file exists and loop through .0, .1, etc. to avoid collisions
if [ -f "$ENCRYPTED_FILE" ] # if file exists, decrypt
then
@orangecms
orangecms / gpg-source.sh
Last active March 19, 2016 20:51
Simply source a gpg-encrypted shell script
#!/bin/bash
# Since the exported env vars would only exist in this script,
# you will have to source this file and then call the function.
function gpg-source {
# if $1 is set, source the corresponding file
if [ -n "$1" ]
then
if [ -f "$1" ]
@orangecms
orangecms / gpg-less.sh
Created March 18, 2016 16:21
Simply read a gpg-encrypted file in less
#!/bin/bash
# if $1 is set, source the corresponding file
if [ -n "$1" ]
then
if [ -f "$1" ]
then
gpg --decrypt $1 2> /dev/null | less
else
echo "File does not exist."
#!/bin/env bash
if [ ! -n "$1" ]; then echo "Please provide a project name."; exit; fi
# 1. create app
mkdir $1
cd $1
meteor create src
cd src
# 2. remove scaffolding junk
@orangecms
orangecms / podcasts.opml
Created June 12, 2016 22:21
My podcasts subscriptions - mostly tech, specifically FLOSS, web, JavaScript, and Artificial Intelligence
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.1">
<head>
<title>BeyondPod Feeds</title>
<dateCreated>Mon, 13 Jun 2016 00:15:21 GMT+02:00</dateCreated>
<dateModified>Mon, 13 Jun 2016 00:15:21 GMT+02:00</dateModified>
</head>
<body>
<outline text="Uncategorized" />
<outline text="JS/web">
@orangecms
orangecms / .eslintrc.yml
Created June 28, 2016 13:47 — forked from dferber90/.eslintrc.yml
Example setup of ESLint-plugin-Meteor with AirBnB's code style
# enable ES6
parserOptions:
ecmaVersion: 6
sourceType: "module"
ecmaFeatures:
jsx: true # enable React's JSX
# register plugins
plugins:
- meteor
#!/usr/bin/bash
_KEY=$1
curl "https://keyserver.opensuse.org/pks/lookup?op=get&search=0x$_KEY" | tail -n +13 | head -n -2 > "/tmp/$_KEY.asc"
gpg --import "/tmp/$_KEY.asc"
rm "/tmp/$_KEY.asc"
@orangecms
orangecms / linux-localversion-git-branch-name.sh
Created May 15, 2017 14:33
A simple one-liner to get the current branch name in your Linux kernel `.config` 🎉
#!/bin/bash
sed -i "s/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=\"$(git branch | grep "*" | cut -b 3-)\"/" .config
@orangecms
orangecms / xlsx2json.sh
Created July 15, 2017 08:03
Convert xlsx spreadsheets to JSON :)
#!/bin/bash
# Preconditions:
# Before using this script, you need to have additional tools. Preferably, use
# your system package manager to install `csv2json`, `jsonlint` and `xslx2csv`.
# Alternatively, if you have `node`, `npm`, `python` and `pip`, run
# `npm i -g csv2json jsonlint && pip install xlsx2csv` for the unclean way.
# WARNING: You may have to adjust your `$PATH` then and you will need to track
# updates yourself. Do this at your own risk only.