Skip to content

Instantly share code, notes, and snippets.

@sheck
sheck / rubocop.rb
Created October 10, 2019 23:22 — forked from skanev/rubocop.rb
A Rubocop wrapper that checks only added/modified code
#!/usr/bin/env ruby
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.
#
# Here are some options you can pass in addition to the ones in rubocop:
#
@sheck
sheck / fittedSize.js
Created October 8, 2019 18:29 — forked from nrkn/fittedSize.js
Get best fontSize to use to fit text in bounds in PDFKit
var Pdf = require( 'pdfkit' );
var fs = require( 'fs' );
var lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in suscipit purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus nec hendrerit felis. Morbi aliquam facilisis risus eu lacinia. Sed eu leo in turpis fringilla hendrerit. Ut nec accumsan nisl. Suspendisse rhoncus nisl posuere tortor tempus et dapibus elit porta. Cras leo neque, elementum a rhoncus ut, vestibulum non nibh. Phasellus pretium justo turpis. Etiam vulputate, odio vitae tincidunt ultricies, eros odio dapibus nisi, ut tincidunt lacus arcu eu elit. Aenean velit erat, vehicula eget lacinia ut, dignissim non tellus. Aliquam nec lacus mi, sed vestibulum nunc. Suspendisse potenti. Curabitur vitae sem turpis. Vestibulum sed neque eget dolor dapibus porttitor at sit amet sem. Fusce a turpis lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;';
var temp = new Pdf();
function measureH
@sheck
sheck / stats
Created November 7, 2018 22:55
Generate csv of historical file counts in folders in a git repository
#!/usr/bin/env ruby
# rubocop:disable all
require 'date'
`touch stats.csv`
`echo 'date,base file count,comparison file count' > stats.csv`
def run(date)
sha = `git rev-list -n 1 --before="#{date.to_s}" master`.chomp

Keybase proof

I hereby claim:

  • I am sheck on github.
  • I am sheck (https://keybase.io/sheck) on keybase.
  • I have a public key whose fingerprint is DEF0 BA1A 3583 F999 3612 FEA8 D9FA CDFB 807F C662

To claim this, I am signing this object:

@sheck
sheck / circle.yml
Last active June 7, 2016 23:05
Using Zbar (with JPEG patch) with Circle CI
machine:
environment:
ZBAR_LIB: vendor/lib/libzbar.so
dependencies:
cache_directories:
- vendor/lib
pre:
- bash ./setup-ci.sh
@sheck
sheck / seti.css
Created October 18, 2015 04:51
Seti UI Theme for Pygments highlighting (jekyll, github pages)
.highlight .hll { background-color: #ffffcc }
.highlight { background: #151718; color: #d4d7d6; background-color: #151718 }
.highlight .c { color: #41535b; background-color: #151718 } /* Comment */
.highlight .err { color: #d4d7d6; background-color: #151718 } /* Error */
.highlight .esc { color: #d4d7d6; background-color: #151718 } /* Escape */
.highlight .g { color: #d4d7d6; background-color: #151718 } /* Generic */
.highlight .k { color: #9fca56; background-color: #151718 } /* Keyword */
.highlight .l { color: #d4d7d6; background-color: #151718 } /* Literal */
.highlight .n { color: #d4d7d6; background-color: #151718 } /* Name */
.highlight .o { color: #d4d7d6; background-color: #151718 } /* Operator */
@sheck
sheck / kitchen-sink.html
Created August 10, 2015 21:47
Rock Bootstrap Kitchen Sink
<!-- Navbar
================================================== -->
<div class="bs-docs-section clearfix">
<div class="row">
<div class="col-lg-12">
<div class="page-header">
<h1 id="navbar">Navbar</h1>
</div>
<div class="bs-component">