Skip to content

Instantly share code, notes, and snippets.

View arempe93's full-sized avatar

Andrew Rempe arempe93

View GitHub Profile
@arempe93
arempe93 / Autocomplete.tsx
Created January 28, 2020 19:55
React autocomplete
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import styled from 'styled-components'
import useDebouncedValue from '@/hooks/useDebouncedValue'
import Flex from '@/components/Flex'
import Icon from '@/components/Icon'
import Input from '@/components/Input'
import Text from '@/components/Text'
@arempe93
arempe93 / clubhouse-commit-msg
Last active October 1, 2019 19:17
Automatic commit msg prefix for Clubhouse
#!/bin/bash
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_ADDED=$(grep -c "\[$BRANCH_NAME\]" $1)
## if branch was not manually added and BRANCH_NAME is not empty + starts with "ch"
if ! [[ $BRANCH_ADDED -ge 1 ]] && [ -n $BRANCH_NAME ] && [[ $BRANCH_NAME =~ ^ch.* ]]; then
# remove everything after - or / (ch122/my-branch => ch122)
BRANCH_NAME="${BRANCH_NAME%%[-/]*}"
@arempe93
arempe93 / git.md
Created July 25, 2018 14:39
A guide of my git practices
@arempe93
arempe93 / spec.rake
Last active June 2, 2018 22:31
Adds a spec:lint rake task to detect debugging code in specs, such as logging or rspec tags
require 'English'
FOUND_RESULTS = 0
NO_RESULTS = 1
ERROR = 2
DEBUGGING_CODE = [
'"puts "',
'" p "',
'"focus: true"'
@arempe93
arempe93 / comments.rb
Created March 19, 2018 19:38
Grape route metaprogramming
# frozen_string_literal: true
module API
module Client
class Comments < Grape::API
[Post, Profile, Story].each do |model|
namespace model.table_name do
route_param :ref, type: String do
namespace :comments do
desc "List comments for #{model.name.downcase}"
@arempe93
arempe93 / eth.md
Last active July 26, 2023 00:23
Ethereum addresses
  • 0xa7038d1C6A29C7C37A2766e548A1D3348475cF2f
@arempe93
arempe93 / btc.md
Last active November 30, 2017 03:32
Bitcoin Address
  • 385NnPg8GjKLStp8LjK1xBzenp651FZnMn
  • 3Czy8uqTTDHay2HwPFLCwBaJbwS81LfzTF
  • 3GhnkZYKYCXBB5AbAMo1PDGUVSaLSrVUC9
  • 3Ci9QAwZKQcosERBE6MYRDtU3twYcY2pHT
@arempe93
arempe93 / convert.sh
Created January 31, 2017 19:52
ImageMagick Greyscale to Black Alpha
convert greyscale.png -set colorspace gray \
-negate -background black -alpha shape -background black -alpha background \
PNG32:black_with_alpha.png
@arempe93
arempe93 / len_LRS.cpp
Last active July 21, 2016 19:24 — forked from celic/len_LRS.cpp
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <list>
using namespace std;
int longest_repeated_string(string text){
@arempe93
arempe93 / index.js
Last active June 23, 2016 18:00
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
'use strict';
//
// es6 translation of below - made with https://babeljs.io/repl/
//
// import axios from 'axios'
//