This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/nginx/snippets/letsencrypt.conf | |
location ^~ /.well-known/acme-challenge/ { | |
default_type "text/plain"; | |
root /srv/www/letsencrypt; | |
} | |
# Hide /acme-challenge subdirectory and return 404 on all requests. | |
location = /.well-known/acme-challenge/ { | |
return 404; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Renci.SshNet; | |
using SendGrid; | |
using SendGrid.Helpers.Mail; | |
using System; | |
using System.IO; | |
using System.Linq; | |
namespace PlayBall | |
{ | |
internal class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CRMProject.Domain; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.ChangeTracking; | |
using System; | |
namespace Infrastructure.Data | |
{ | |
public class AppDbContext : DbContext | |
{ | |
public DbSet<Contact> Contacts { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with the same name as the keys in <tt>filtering_params</tt> | |
# with their associated values. Most useful for calling named scopes from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'base64' | |
require 'open-uri' | |
require 'net/http' | |
require 'net/https' | |
require 'json' | |
class OCR | |
attr_reader :api_key, :image_url | |
def self.scan(api_key:, image_url:) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mailbox | |
# Open the mbox files (relative to your present working directory) | |
# Note, Mail.app actually exports a mbox folder that contains an mbox file | |
mbox1 = mailbox.mbox('Old-Archive.mbox/mbox') | |
mbox2 = mailbox.mbox('New-Archive.mbox/mbox') | |
# Use something like `subject` to unique the messages | |
# or they will all be unique. | |
def subjects(mbox): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Use `~/Downloads` to store incomplete downloads | |
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true | |
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Downloads" | |
# Do not prompt for confirmation before downloading | |
defaults write org.m0k.transmission DownloadAsk -bool false | |
# Trash original torrent files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
sudo: yes | |
tasks: | |
- name: "test for swap partition" | |
shell: 'sudo swapon -s | grep -E "^/"' | |
register: swapfile | |
ignore_errors: yes |
NewerOlder