Skip to content

Instantly share code, notes, and snippets.

View ArmandoKenneth's full-sized avatar
:shipit:
😬 This is the way

Armando Rocha ArmandoKenneth

:shipit:
😬 This is the way
  • London
  • 23:18 (UTC)
View GitHub Profile
@bbshih
bbshih / momentMock.js
Last active February 22, 2023 18:27 — forked from lededje/gist:44aeddf1dc2a5e6064e3b29dc35a7a2d
Jest Mocking Moment to same time zone for tests
// To mock globally in all your tests, add to setupTestFrameworkScriptFile in config:
// https://facebook.github.io/jest/docs/en/configuration.html#setuptestframeworkscriptfile-string
jest.mock('moment', () => {
const moment = require.requireActual('moment-timezone');
moment.tz.setDefault('America/Los_Angeles'); // Whatever timezone you want
return moment;
});
@iloveitaly
iloveitaly / stripe_create_subscription.rb
Last active January 30, 2019 23:22
Example of how to create a Stripe Subscription and push it into NetSuite using http://SuiteSync.io/
# Michael Bianco <mike@suitesync.io>
# Description: Create a Stripe Subscription
# Link: https://gist.github.com/iloveitaly/c07975fe902a1c6259558c181d8602d4
# Usage:
#
# export STRIPE_KEY=sk_test
# gem install stripe
# ruby stripe_create_subscription.rb
@alexpchin
alexpchin / Rails_Generating_and_Scaffolding.md
Last active July 29, 2025 13:16
Rails Generating & Scaffolding

Rails Generating & Scaffolding

Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.

This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...

Coming from another language like PHP, this can seem like magic.