Skip to content

Instantly share code, notes, and snippets.

View clayrisser's full-sized avatar
🤓
coding

Clay Risser clayrisser

🤓
coding
View GitHub Profile
@clayrisser
clayrisser / increase_inotify.sh
Last active November 26, 2019 09:50
Increase Inotify
#!/bin/sh
test -f /etc/sysctl.conf && \
(sudo sed -i 's/fs.inotify.max_user_watches=[[:digit:]]*//g' /etc/sysctl.conf && \
sudo sed -i '/^$/d' /etc/sysctl.conf && \
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p) || true
@clayrisser
clayrisser / qini.py
Last active September 11, 2019 13:43
Restic AWS Credentials Wrapper
#!/usr/bin/python3
import os
import sys
from configparser import ConfigParser
config = ConfigParser()
config.read(os.path.abspath(sys.argv[1]))
def get_value(path, value):
@clayrisser
clayrisser / gpg.md
Last active March 4, 2019 06:16
How to use gpg

Install

OSX

brew install gnupg

Ubuntu

sudo apt-get install gnupg
@clayrisser
clayrisser / Button.js
Last active February 28, 2019 06:00
Styled components Button
import React, { Component } from "react";
import { Button as NativeButton } from "native-base";
import Text from "../Text";
import PropTypes from "prop-types";
export default class Button extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
onPress: PropTypes.func
};
function helloWorld() {
console.log('hello world');
}
provider "aws" {
region = "us-west-2"
shared_credentials_file = "~/.aws/credentials"
}
resource "aws_iam_user" "user" {
name = "some-new-aws-user"
}
resource "aws_iam_user_policy_attachment" "test-attach" {
alert()
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Document</title>
</head>
<body>
<a onclick="loginGithub()" href="#">Login w/ GitHub</a>
</body>
<script>
@clayrisser
clayrisser / getH2Content.js
Created September 23, 2017 20:15
Get h2 tag content
var h2Tags = document.getElementsByTagName('h2');
var h2Inner = [];
for (var i = 0; i < h2Tags.length; i++) {
var h2Tag = h2Tags[i];
if (h2Tag.getElementsByTagName('a').length > 0) {
h2Inner.push(h2Tag.getElementsByTagName('a')[0].innerHTML);
} else {
h2Inner.push(h2Tag.innerHTML);
}
@clayrisser
clayrisser / awards.js
Created June 16, 2017 18:03
ProManager Awards
/**
* Awards Configuration
* (app.config.awards)
*
* @notice: If two awards have different deltaTime rules in a single action,
* the first one to reset the lastTime will reset the
* lastTime for both of them
*
* @notice: channelCount gets counted even if deltaTime fails
*