Skip to content

Instantly share code, notes, and snippets.

View brossetti1's full-sized avatar

Brian Rossetti brossetti1

View GitHub Profile
group :spec do
guard('rspec', all_on_start: false,
all_after_pass: false,
run_all: { parallel: true, parallel_cli: '-n 4' },
cmd: 'zeus rspec',
notification: true,
failed_mode: :keep) do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
(function() {
var k, aa = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) {
if (c.get || c.set) throw new TypeError("ES3 does not support getters and setters.");
a != Array.prototype && a != Object.prototype && (a[b] = c.value)
},
ba = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : this,
ca = function(a, b) {
if (b) {
for (var c = ba, d = a.split("."), e = 0; e < d.length - 1; e++) {
var f = d[e];
@brossetti1
brossetti1 / history
Created July 5, 2018 21:08
history functions that are good to have
zsh histroy
pry history
@brossetti1
brossetti1 / README.md
Created August 7, 2018 10:36 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@brossetti1
brossetti1 / useful-regex.md
Last active August 1, 2024 17:58
useful regex expressions

https://www.labnol.org/internet/regular-expressions-forms/28380/

Postal Address

[a-zA-Z\d\s\-\,\#\.\+]+

allow only alphanumeric characters, spaces and few other characters like comma, period and hash symbol in the form input field.

ZIP Code

^\d{5,6}(?:[-\s]\d{4})?$

the regex allows ZIP codes in standard formats and it matches both US and Indian pincodes.

@brossetti1
brossetti1 / get_gists.py
Created January 23, 2019 01:26 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
https://angularfirebase.com/
https://1stwebdesigner.com/copy-and-paste-css-animation-cheat-sheets/ - copy paste css animations
@brossetti1
brossetti1 / gist:2dc6b5a4e8f83cb8d07610a6292a7864
Created April 7, 2019 22:06 — forked from jeromedalbert/gist:5332994
The different ways to define class methods in Ruby.
class MyClass
# All of these are equivalent
def self.myMethod
true
end
def MyClass.myMethod
true
end

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

Keybase proof

I hereby claim:

  • I am brossetti1 on github.
  • I am brossetti1 (https://keybase.io/brossetti1) on keybase.
  • I have a public key ASANGNqg1IjCMOv0QDBUhTvrmM1ty3w8P14XRSubi3qVgAo

To claim this, I am signing this object: