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 'fileutils' | |
PROJECT_NAME = 'your_project_name' | |
TARGETS_TO_CONSOLIDATE = %w[ | |
app/apollo | |
app/components | |
app/context | |
app/graphql | |
app/hooks |
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 'fileutils' | |
# Add the folders you want to consolidate the files from. | |
TARGETS_TO_CONSOLIDATE = %w[ | |
app/controllers | |
app/models | |
app/commands | |
app/helpers | |
app/jobs | |
app/notifiers |
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
var http = require('http'); | |
var tailwind = require('./tailwind.config.js'); | |
http | |
.createServer(function (req, res) { | |
var html = buildHtml(req); | |
res.writeHead(200, { | |
'Content-Type': 'text/html', | |
'Content-Length': html.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
const configuration = { | |
domain: 'https://clover.com/', | |
merchantId: 'private', | |
oauthToken: 'private' | |
}; | |
const devicesUrl = configuration.domain + | |
"v3/merchants/" + configuration.merchantId + | |
"/devices?access_token=" + configuration.oauthToken; |
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
onPhotoSourceReq: (request, callback)-> | |
photos = [] | |
$.getJSON('/api/v1/moments/photos', (moments)-> | |
if moments.length > 0 | |
photos = _.flatten(_.map(moments, (m)-> | |
return _.map(m.photos, (p)-> | |
return p | |
) | |
)) |
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
# vi ~/.ssh/config | |
Host github.com | |
Hostname ssh.github.com | |
Port 443 | |
Host bitbucket.org | |
Hostname altssh.bitbucket.org | |
Port 443 |
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
# Original: http://www.snip2code.com/Snippet/256399/Amazon-Elastic-Beanstalk-Sidekiq | |
commands: | |
create_post_dir: | |
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post" | |
ignoreErrors: true | |
files: | |
"/etc/rsyslog.d/11-sidekiq.conf": | |
mode: '000644' | |
content: | | |
EB_CONFIG_APP_LOGS=$(/opt/elasticbeanstalk/bin/get-config container -k app_log_dir) |
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 'date' | |
require 'koala' | |
class BirthdayLiker | |
FACEBOOK_TOKEN = 'your_oauth_key' | |
BIRTHDAY_WORDS = %w(birthday bday birfday birth born) | |
THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!'] | |
DATE_TIME_FORMAT = '%Y-%m-%d' | |
def initialize(birthdate, opts={}) |
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
# Below I have a name class. It has no properties defined. I want to be able to dynamically | |
# build it into what I want. This allows me to not have to write code for every scenario, I can | |
# let the developer decide what it should include. | |
class Name | |
ALLOWED_NAME_PARTS = %w(prefix first middle last suffix) | |
def initialize(&block) | |
self.instance_eval(&block) if block_given? | |
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
namespace :beta_invites do | |
namespace :phase_one do | |
desc 'Send Phase 1 Beta Invites to testers.' | |
task :all => :environment do | |
BetaInvite.all.uniq{|b| b.email}.each do |invite| | |
unless invite.email.blank? | |
email_message = BetaInviteMail.invitation(invite.email) | |
email_message.deliver | |
end | |
end |
NewerOlder