Skip to content

Instantly share code, notes, and snippets.

<html>
<body>
test
</body>
</html>
<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<style type="text/css">
.block {
background:red;
width:1024px;
height: 512px;
color: white;
@schpet
schpet / bootstrap-typeahead-hacks.coffee
Last active December 14, 2015 16:58
A collection of bootstrap-typeahead.js hacks: don't autocomplete and have the tab key move your selection (coffeescript & js versions)
$.fn.typeahead.Constructor::render = (items) ->
items = $(items).map (i, item) =>
i = $(@options.item).attr("data-value", item)
i.find("a").html @highlighter(item)
i[0]
@$menu.html items
this
@schpet
schpet / gallery.html
Created May 6, 2013 02:07
ghetto gallery generator for jekyll - put images in directories inside _galleries - add gallery.html to layouts
@schpet
schpet / gifplease.sh
Created July 7, 2013 08:29
Turn a directory of jpegs into a gif
mogrify -format gif -resize 400 *.jpg
gifsicle --delay=20 --loop *.gif > yep.gif
"""
Outputs history with bash and git aliases expanded.
"""
import re
from subprocess import check_output
BASH_ALIASES = {}
#for line in check_output('bash -i -c "alias -p"', shell=True).split('\n'):
for line in check_output('zsh -i -c "alias"', shell=True).split('\n'):

Keybase proof

I hereby claim:

  • I am schpet on github.
  • I am schpet (https://keybase.io/schpet) on keybase.
  • I have a public key whose fingerprint is E704 E886 111A 5A35 F26F C8EF DA72 7087 E288 6EE0

To claim this, I am signing this object:

diff --git a/src/containers/Root.js b/src/containers/Root.js
index fecb1e4..c2ad380 100644
--- a/src/containers/Root.js
+++ b/src/containers/Root.js
@@ -21,12 +21,12 @@ export default class Root extends React.Component {
if (__DEBUG__) {
if (__DEBUG_NEW_WINDOW__) {
if (!window.devToolsExtension) {
- require('../redux/utils/createDevToolsWindow').default(this.props.store)
+ require('../redux/utils/createDevToolsWindow')(this.props.store)
@schpet
schpet / invalid_records.rake
Created February 18, 2016 19:35
Find all invalid ActiveRecord records
namespace "invalid_records" do
desc "Find all invalid records"
task find_all: :environment do
Rails.application.eager_load!
i = 0
invalid_records = ActiveRecord::Base.subclasses.map do |active_record_class|
begin
next if active_record_class&.abstract_class == true
ids = active_record_class.unscoped.pluck(:id)
diff --git db/migrate/20170712145519_add_unique_short_id_function.rb db/migrate/20170712145519_add_unique_short_id_function.rb
new file mode 100644
index 0000000..4342d8b
--- /dev/null
+++ db/migrate/20170712145519_add_unique_short_id_function.rb
@@ -0,0 +1,76 @@
+class AddUniqueShortIdFunction < ActiveRecord::Migration[5.1]
+ def up
+ # if needed:
+ # enable_extension 'pgcrypto'