Skip to content

Instantly share code, notes, and snippets.

View drunkhacker's full-sized avatar
🚕

Jaehwa Han drunkhacker

🚕
  • easi6 inc
  • Seoul
View GitHub Profile
<configuration>
<conversionRule conversionWord="coloredLevel" converterClass="play.api.Logger$ColoredLevel" />
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${application.home}/logs/application.log</file>
<encoder>
<pattern>%date{yy.MM.dd HH:mm:ss} %coloredLevel %-20replace(%caller{3}){'(Caller\+0.*\n)|(Caller\+1.*\n)|(Caller\+2.*\()|(\))|(\n)',''} %replace( %logger{15} -){"\ application\ \-",""} %message%n%xException{5}</pattern>
<!-- <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n%replace(%caller{3}){'(Caller\+0.*\n)|(Caller\+1.*\n)|(Caller\+2\s)',''}</pattern>-->
</encoder>
</appender>
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
require 'fog'
conn = Fog::Storage.new(:provider => 'AWS')
conn.get_bucket("doors-and-dots").body["Contents"].each do |h|
key = h["Key"]
if key.match /square100\.[a-z]+$/
puts "processing #{key}"
obj = conn.get_object("doors-and-dots", key)
newkey = key.gsub /square100/, 'square200'
conn.put_object("doors-and-dots", newkey, obj.body, {"x-amz-acl"=>"public-read", "Content-Type"=>"image/jpeg"})
end
@drunkhacker
drunkhacker / ng-bare
Last active December 28, 2015 04:49
remove .git
#!/bin/bash
if [ $1 ]; then
git clone --depth=1 git@github.com:drunkhacker/ng-bare.git $1 $2 $3
rm -rf $1/.git
VERSION=${3:-0.0.1-SNAPSHOT}
APPNAME=${2:-my-app}
sed -i '' -e s/\$APPNAME/$APPNAME/g\;s/\$VERSION/$VERSION/g $1/package.json
sed -i '' -e s/\$APPNAME/$APPNAME/g\;s/\$VERSION/$VERSION/g $1/bower.json
const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
const config = new Config();
config.apiKey = 'REDACTED';
config.merchantAccount = 'MVL_TADAECOM';
const client = new Client({config});
client.setEnvironment('TEST');
const checkout = new CheckoutAPI(client);
(async function() {
const amount = {currency: 'SGD', value: 2000};