Skip to content

Instantly share code, notes, and snippets.

View wikimo's full-sized avatar
😀

wikimo wikimo

😀
View GitHub Profile
@eparreno
eparreno / sidekiq_delete_jobs.md
Last active May 31, 2024 20:18
How to delete Sidekiq jobs in a Rails app using ActiveJobs

How to delete Sidekiq jobs in a Rails app using ActiveJobs

Sidekiq jobs can be enqueued or scheduled. Enqueued means that they are gonna be picked up as soon as possible, scheduled jobs will be enqueued at some specific time.

job_id and jid

When using ActiveJobs, Rails will return a job_id after sending the job to ActiveJobs

job = UserMailer.send_invite(params).deliver_later
@priyank-gupta
priyank-gupta / whenever.rb
Created June 27, 2015 11:32
Mina whenever with roles
# # Modules: Whenever
# Adds settings and tasks for managing projects with [whenever].
#
# [whenever]: http://rubygems.org/gems/whenever
#
#
# ## Common usage
# require 'mina/whenever'
#
# task :deploy => :environment do
@jcouyang
jcouyang / 3-reason-to-use-jest-to-test-your-javascript.md
Last active March 24, 2019 13:58
用 jest 轻松测试 JavaScript

Javascript 的测试, 不管在用 jasmine 还是 mocha, 都是很头疼的事情. 但是自从有了 jest, 一口气写7个测试, 腰也不疼了, 头也不疼了.

只需要 3 个理由

在说用 jest 测为什么好之前,我们先来看我们要测的一个例子.

@sebmarkbage
sebmarkbage / ElementFactoriesAndJSX.md
Last active May 17, 2022 11:06
New React Element Factories and JSX

New React Element Factories and JSX

In React 0.12, we're making a core change to how React.createClass(...) and JSX works.

If you're using JSX in the typical way for all (and only) React components, then this transition will be seamless. Otherwise there are some minor breaking changes described below.

The Problem

@juanje
juanje / web_assertions.rb
Last active September 7, 2025 19:48
Examples of custom assertions for remote conections with MiniTest

This is a short and simple example of custom assertions for Minitest.

They are very basic, but they help me to learn it. And I can use the to test some very simple use case of remote conection without install a bunch of gems.

I learn what I needed for this from this article and the minitest-chef-handler's code.

It can be improved a lot using Nokogiri and other Ruby libraries.