Skip to content

Instantly share code, notes, and snippets.

View aconfee's full-sized avatar

Adam Estela aconfee

  • Spotify
  • Austin, TX
View GitHub Profile
var AWS = require('aws-sdk');
AWS.config.region = 'us-west-2';
AWS.config.update({
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
});
var s3 = new AWS.S3({params: {Bucket: process.env.S3_BUCKET_NAME}});
@aconfee
aconfee / gist:b3a54e746d21448db5327063dfff209d
Last active September 10, 2016 17:10
Angular 2 Safari Bug
<div galleryScroll class='gallery-image-container hide-gallery' [class.show-gallery]='showGallery'></div>
private sortedItemsToBalancedColumns(orderedValues: any, numberOfColumns: number): any[] {
var numberOfValues = orderedValues.length;
var numberOfCompleteRows = Math.floor(numberOfValues / numberOfColumns);
var lengthOfExtraRow = numberOfValues % numberOfColumns;
var columns = new Array(numberOfColumns);
for (let i = 0; i < numberOfColumns; i++) {
if (lengthOfExtraRow > 0) {
columns[i] = orderedValues.splice(0, numberOfCompleteRows + 1);
{
"properties": {
"BodyType":{
"type":"string",
"fields":{
"Raw":{
"type":"string",
"analyzer": "trim"
}
},
begin
for i in (select * from vehiclecache.auctionvehicles where auctiondate > sysdate and ((make = 'Chevrolet' and model = 'Cruze') or make = 'Tesla'))
loop
vehiclecache.avindexqueueservice.AddToQueue(i.id, 'U');
end loop;
end;
$@"INSERT INTO omnicounts (
createduserid,
dealerid,
userid,
buylistitems7d,
buylistitems14d,
buylistitems30d,
buylist7d,
buylist14d,
buylist30d,
@aconfee
aconfee / puma.rb
Last active March 19, 2020 00:04
/myapp/config/puma.rb
# Change to match your CPU core count
workers 1
# Min and Max threads per worker
threads 1, 6
directory "/home/rails/RubyFinanceTracker"
app_dir = File.expand_path("../..", __FILE__)
shared_dir = "#{app_dir}/shared"
@aconfee
aconfee / config.ru
Created February 19, 2017 03:14
/myapp/config.ru
# This file is used by Rack-based servers to start the application.
require_relative 'config/environment'
run Rails.application
@aconfee
aconfee / puma.service
Last active July 3, 2018 07:50
etc/systemd/system/puma.service
[Unit]
Description=Puma HTTP Server
After=network.target
# Uncomment for socket activation (see below)
# Requires=puma.socket
[Service]
# Foreground process (do not use --daemon in ExecStart or config.rb)
Type=simple
private matchTargetPriceBucket(ruleSet: Models.IPricingTargetRuleSet, dayValue: number): number {
if (ruleSet === null || ruleSet.Rules.length === 0) {
console.error("No price buckets were provided.");
return null;
}
if (!dayValue || dayValue < 0) {
console.error("Invalid day value. Won't match any price target bucket.");
return null;
}