Skip to content

Instantly share code, notes, and snippets.

@baileyparker
baileyparker / .gitignore
Last active March 6, 2019 17:22
AMD64 Pseudo-"Conditional Call" Benchmark
bin/
catch.hpp
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
@baileyparker
baileyparker / .gitignore
Last active February 24, 2019 22:10
Limited functional currying utility Python (like functools.partial)
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@baileyparker
baileyparker / .gitignore
Last active August 17, 2018 06:24
Tests and benchmarks for widest 0-bit gap and de Bruijn vs ffs (https://codereview.stackexchange.com/q/201846/8639)
bin/
catch.hpp
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
@baileyparker
baileyparker / fix-bup-slahes.sh
Created August 3, 2018 20:24
Script that removes slashes from bup backup names
#!/bin/bash
set -e
if [ "$#" -eq "1" ]; then
git_dir="$1"
else
if [ "$#" -eq "0" ]; then
git_dir="~/.bup"
else
@baileyparker
baileyparker / LICENSE.md
Last active July 24, 2020 09:32
Calculator parser implemented in Python

MIT License

Copyright (c) 2018 Bailey Parker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@baileyparker
baileyparker / keybase.md
Created February 3, 2018 14:34
keybase.md

Keybase proof

I hereby claim:

  • I am baileyparker on github.
  • I am baileyparker (https://keybase.io/baileyparker) on keybase.
  • I have a public key whose fingerprint is 5094 E96D 559C 16C0 DE72 24D8 B732 B033 3C75 32C0

To claim this, I am signing this object:

@baileyparker
baileyparker / persistent_decorator.py
Last active January 25, 2018 18:47
MetaBrainz chatbox voting plugin cleanup for codereview.stackexchange.com
from functools import wraps
from inspect import ismethod
class PersistentDecorator(object):
def __init__(self, decorated_object, save):
self._decorated_object = decorated_object
self._save = save
def __getattribute__(self, attr):
import Ember from 'ember';
export default Ember.Component.extend({
value: '',
actions: {
onKeydown(e) {
if (e.keyCode === 13) {
// Upon pressing enter, field should clear
console.log('got enter, clearing...');
@baileyparker
baileyparker / components.test-textarea.js
Last active July 20, 2017 03:48
Two Way Bound Textarea
import Ember from 'ember';
export default Ember.Component.extend({
value: '',
actions: {
input: function(e) {
let value = e.target.value,
filteredValue = value.toUpperCase().replace(/[\r\n\v]/g, '');
console.log('before', value, 'after', filteredValue, 'end');
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
scroll: function(e) {
this.set('text', this.get('text') + ' scroll!');
},
scroll: function(e) {
this.set('text2', this.get('text2') + ' scroll!');
},