Skip to content

Instantly share code, notes, and snippets.

@GesJeremie
GesJeremie / covers.rake
Created September 26, 2023 15:16
Rake task to create thumbnails of static images
require 'mini_magick'
namespace :covers do
def covers_path
Rails.root.join('app', 'assets', 'images', 'covers')
end
def files_inside_covers_path
Dir.glob(covers_path.to_s << '/**/*').select { |path| File.file?(path) }
end
@GesJeremie
GesJeremie / query.ts
Created May 16, 2022 22:19
Shopify – GraphQL query to retrieve orders pending fulfillment
// fulfillment_status statuses: shipped, partial, unshipped, any, unfulfilled
export default `
query GetOrdersPendingFulfillment {
orders(first: 250, query: "fulfillment_status:unfulfilled") {
pageInfo {
hasNextPage
}
edges {
node {
id

Keybase proof

I hereby claim:

  • I am GesJeremie on github.
  • I am gesjeremie (https://keybase.io/gesjeremie) on keybase.
  • I have a public key whose fingerprint is 03B9 7800 6E57 04D5 6779 5584 8F99 6EE2 AF52 7C35

To claim this, I am signing this object:

@GesJeremie
GesJeremie / list-countries-elixir.ex
Last active October 9, 2020 00:02
List countries elixir
countries = [
%{code: "AF", name: "Afghanistan"},
%{code: "AX", name: "Åland Islands"},
%{code: "AL", name: "Albania"},
%{code: "DZ", name: "Algeria"},
%{code: "AS", name: "American Samoa"},
%{code: "AD", name: "Andorra"},
%{code: "AO", name: "Angola"},
%{code: "AI", name: "Anguilla"},
%{code: "AQ", name: "Antarctica"},
@GesJeremie
GesJeremie / EmailExampleTest.php
Created November 23, 2015 02:58
Email test case for testing emails with Mailtrap.io in Phpunit
<?php
/*
|--------------------------------------------------------------------------
| EmailExampleTest
|--------------------------------------------------------------------------
|
| Email test case for testing emails with Mailtrap.io in Phpunit
|
| Requirements:
| - Laravel 5.1
def create_contact(conn, %{"classified_contact" => params, "id" => id}) do
with {:ok, conn} <- CreateContactOperation.run(conn, params, %{classified_id: id}) do
conn
|> redirect(to: app_classified_path(conn, :show, id))
else
{:error, conn} ->
conn
|> show(%{"id" => id})
end
defmodule Babysitting.Operations.Classified.CreateContactOperation do
import Plug.Conn;
alias Babysitting.Repo;
alias Babysitting.{ClassifiedContact}
alias Babysitting.Changesets.{ClassifiedContactChangeset}
def run(conn, params, options) do
conn = assign(conn, :params, params)
conn = assign(conn, :options, options)
@GesJeremie
GesJeremie / deploy.php
Last active April 11, 2017 13:56
Laravel 5 example deployer
<?php
/**
* Require dependency
*/
require_once 'recipe/common.php';
/**
* How many releases we want to keep
*/

Keybase proof

I hereby claim:

  • I am GesJeremie on github.
  • I am gesjeremie (https://keybase.io/gesjeremie) on keybase.
  • I have a public key whose fingerprint is 62AC 3C92 E55E 184B 6815 33EF 174E D6C5 6732 B3F1

To claim this, I am signing this object: