Create a new Automater flow
Add 'Service'. Service receives 'no input' in 'iTerm'. Add 'Run AppleScript'.
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> | |
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/> | |
<appender name="CLOUD_WATCH_FRIENDLY" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m %replace(%rEx{short}){'[\r\n\t]+', '\\n'}%nopex%n</pattern> | |
</encoder> |
import javax.validation.Constraint; | |
import javax.validation.Payload; | |
import java.lang.annotation.*; | |
@Documented | |
@Constraint(validatedBy = ExampleConstraintValidator.class) | |
@Target({ElementType.FIELD}) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface ExampleConstraint { |
------------------------------------------------------------------------------------------------------ | |
#add x-frame-options header | |
add rewrite action act_insert_XFrame_header insert_http_header X-Frame-Options "\"SAMEORIGIN\"" | |
add rewrite policy pol_enforce_XFrame TRUE act_insert_XFrame_header | |
------------------------------------------------------------------------------------------------------ | |
#add HSTS header | |
add rewrite action act_insert_HSTS_header insert_http_header Strict-Transport-Security "\"max-age=157680000; includeSubDomains; preload\"" | |
add rewrite policy pol_enforce_HSTS TRUE act_insert_HSTS_header | |
------------------------------------------------------------------------------------------------------ | |
#add x-xss-protection header |
-- Before importing, you need to create table | |
CREATE TABLE example_table | |
( | |
... | |
); | |
-- Importing... | |
COPY example_table | |
FROM 's3://<BUCKET_NAME>/.../example_table.csv' | |
CREDENTIALS 'aws_access_key_id=...;aws_secret_access_key=...' |
echo "$(TZ='Europe/Moscow' date +%Y-%m-%d\ %H\:%M)" | |
# output => 2019-01-31 16:52 |
#!/usr/local/bin/python3 | |
import os | |
hosts = [ | |
'google.com', | |
'microsoft.com' | |
] | |
header = [] |
public final class TurkishNumberUtils { | |
private static final String SPACE = " "; | |
private static final String EMPTY = ""; | |
private static final String[] PERIOD_NAMES = {EMPTY, "bin", "milyon", "milyar", "trilyon", "katrilyon", "kentilyon"}; | |
private static final String[] UNITS_TEXTS = {EMPTY, "bir", "iki", "üç", "dört", "beş", "altı", "yedi", "sekiz", "dokuz"}; |
lsof -i tcp:8080 | |
# Example output: | |
# COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
# java 86935 ... |
Create a new Automater flow
Add 'Service'. Service receives 'no input' in 'iTerm'. Add 'Run AppleScript'.
#!/usr/bin/python | |
from Foundation import NSWorkspace, NSURL | |
import urllib | |
def show_gists(): | |
NSWorkspace.sharedWorkspace().openURL_(NSURL.URLWithString_('https://gist.github.com/search?q=%40pudquick&ref=searchresults')) | |
def search_gists(search_string): | |
NSWorkspace.sharedWorkspace().openURL_(NSURL.URLWithString_('https://gist.github.com/search?q=%%40pudquick+%s&ref=searchresults' % search_string)) |