Skip to content

Instantly share code, notes, and snippets.

View davidstosik's full-sized avatar
💭
I may be slow to respond.

David Stosik davidstosik

💭
I may be slow to respond.
View GitHub Profile
@davidstosik
davidstosik / mastodon-verification.html
Created November 7, 2022 07:38
Mastodon Verification Gist
<!DOCTYPE html>
<html>
<head>
<title>Mastodon Verification Gist</title>
</head>
<body>
<p>
I'm David Stosik. This is my Mastodon verification gist!
</p>
<ul>
//**************************************************************************************************************************
//**************************************************************************************************************************
// CLEANER-STABLER-DATA-COLLECTION
//**************************************************************************************************************************
//**************************************************************************************************************************
// Wifi libraries
#include <SPI.h>
#include <WiFiNINA.h>

Never check out master instead of main again with this weird trick!

GitHub recently changed the repository's default branch name from master to main, challenging millions of developers' muscle memory:

git checkout master

error: pathspec 'master' did not match any file(s) known to git

git checkout main

@davidstosik
davidstosik / .rubocop.yml.patch
Created June 26, 2020 10:38
Cookpad custom RuboCop cops
diff --git i/.rubocop.yml w/.rubocop.yml
index 1369eedefc..9335038ac7 100644
--- i/.rubocop.yml
+++ w/.rubocop.yml
@@ -1,5 +1,6 @@
require:
- rubocop-rails
+ - "./lib/rubocop-cookpad.rb"
AllCops:
@davidstosik
davidstosik / rubocop|lib|rubocop|cop|style|colon_method_definition.rb
Created June 26, 2020 07:11
Automating the team's code style guides with RuboCop - ColonMethodDefinition
class ColonMethodDefinition < Cop
MSG = 'Do not use `::` for defining class methods.'
def on_defs(node)
return unless node.loc.operator.source == '::'
add_offense(node, location: :operator)
end
def autocorrect(node)
@davidstosik
davidstosik / README.md
Last active November 6, 2019 09:49
Output the RSpec command to reproduce a test run

Output the RSpec command to reproduce a test run

How to use

  • Add rspec_reproducible_order_command.rb to lib/.
  • Use the formatter when running RSpec, in addition to usual formatters:
    rspec --format progress --format RspecReproducibleOrderCommand --out log/rspec_command.txt
  • Shortened example output:
class NewNewPrimesRetrievalService
def self.process(max)
new(max).process
end
def initialize(max)
@max = max
end
def process
@davidstosik
davidstosik / README.md
Last active April 11, 2019 10:46
Bundler and Yarn update git hooks

Git hooks for Ruby on Rails

Tired of forgetting to run bundle after you pulled a branch?

Tired of getting Yarn's integrity error message because you forgot bin/yarn?

Just have Git run those for you after most Git operations that would change Gemfile.lock or package.json!

Install

@davidstosik
davidstosik / main.c
Last active August 29, 2015 14:14
Fixes to github.com/bemn67/MinimalTwist
#include <pebble.h>
#include <time.h>
Window *my_window;
TextLayer *min_layer;
static GFont s_time_font;
static BitmapLayer *s_background_layer;
static GBitmap *s_background_bitmap;
static void update_time() {

Keybase proof

I hereby claim:

  • I am davidstosik on github.
  • I am dstosik (https://keybase.io/dstosik) on keybase.
  • I have a public key whose fingerprint is 55A6 5E36 E683 F4B8 00C1 EE4B BC2D A710 B438 70E4

To claim this, I am signing this object: