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
const minify = require("html-minifier").minify; | |
const fs = require("fs"); | |
const { SESClient, CreateTemplateCommand, UpdateTemplateCommand } = require('@aws-sdk/client-ses'); | |
const sesClient = new SESClient({ | |
region: "us-east-2", | |
credentials: { | |
accessKeyId: "XXXXXXXXXXXXXXXXXXX", | |
secretAccessKey: "XXXXXXXXXXXXXXXXXXXX" | |
}, |
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
# This code is based directly on the Text gem implementation. | |
# Copyright (c) 2006-2013 Paul Battley, Michael Neumann, Tim Fletcher. | |
# | |
# Returns a value representing the "cost" of transforming str1 into str2. | |
# https://github.com/rails/rails/blob/c994a893c18c0456fd2a30efe4debfc2b18e2508/railties/lib/rails/command/behavior.rb | |
def levenshtein_distance(str1, str2) | |
s = str1 | |
t = str2 | |
n = s.length |
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
// | |
// NSDate+RandomDate.h | |
// | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSDate (RandomDate) | |
- (NSDate *)randomDateInYearOfDate; |
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
#define UIColorFromRGB(rgbValue) \ | |
[UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ | |
green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \ | |
blue:((float)((rgbValue & 0x0000FF) >> 0))/255.0 \ | |
alpha:1.0] |
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
module MyGem | |
class Railtie < Rails::Railtie | |
initializer "mygem,configure_rails_initializer" do | |
ApplicationController.before_action( whatever ) | |
end | |
end | |
end |
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
#!/bin/sh | |
mkdir /tmp/ruby-build-patch | |
cd /tmp/ruby-build-patch | |
# download and patch the ruby sources | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar xzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125 | |
curl https://raw.github.com/wayneeseguin/rvm/master/patches/ruby/1.9.3/p125/gcdata.patch | patch -p1 |
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
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]' | |
#default screens | |
screen -t shell1 0 | |
screen -t shell2 1 | |
screen -t shell3 2 | |
screen -t shell4 3 |
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
// | |
// NSBezierPath+Length.h | |
// | |
// Created by mcianni on 10/14/12. | |
// | |
#import <Cocoa/Cocoa.h> | |
@interface NSBezierPath (Length) | |
- (double)length; |