This file contains hidden or 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
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload'; | |
add_header Content-Security-Policy "default-src 'self'; font-src *;img-src * data:; script-src *; style-src *"; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Frame-Options "SAMEORIGIN"; | |
add_header X-Content-Type-Options nosniff; | |
add_header Referrer-Policy "strict-origin"; | |
add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()"; | |
add_header Access-Control-Allow-Origin 'https://<some full domain>'; | |
add_header Access-Control-Allow-Methods 'GET, OPTIONS, HEAD, POST, PUT, DELETE'; | |
add_header Access-Control-Allow-Headers 'Authorization, X-App-Token, X-Access-Token, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type'; |
This file contains hidden or 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
curl_time() { | |
curl -so /dev/null -w "\ | |
namelookup: %{time_namelookup}s\n\ | |
connect: %{time_connect}s\n\ | |
appconnect: %{time_appconnect}s\n\ | |
pretransfer: %{time_pretransfer}s\n\ | |
redirect: %{time_redirect}s\n\ | |
starttransfer: %{time_starttransfer}s\n\ | |
-------------------------\n\ | |
total: %{time_total}s\n" "$@" |
This file contains hidden or 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
/home/<some directories>/log/*.log { | |
daily | |
rotate 7 | |
size 10M | |
compress | |
delaycompress | |
} |
This file contains hidden or 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_relative 'base_exec' | |
class SampleExec < BaseExec | |
def initialize() | |
super() | |
end | |
def run! | |
super |
This file contains hidden or 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
class BaseExec | |
def initialize() | |
@prefix = self.class.name.underscore | |
@pid_file = Rails.root.join("pids/#{@prefix}.pid") | |
@log_file = Rails.root.join("logs/#{@prefix}.log") | |
end | |
def run! |
This file contains hidden or 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 https = require('https'); | |
var util = require('util'); | |
exports.handler = (event, context) => { | |
const message = JSON.parse(event.Records[0].Sns.Message); | |
console.log(JSON.stringify(event, null, 2)); | |
console.log('Data From SNS: ', message); | |
const postData = { |
This file contains hidden or 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
/* | |
* Copyright 2017 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | |
* except in compliance with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under the | |
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
This file contains hidden or 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
Step 1: Create chained certificate with the provided crt files. Ordering is important. | |
~$ cat Server.crt Intermediate.crt Root.crt > Chained_certificate.crt | |
Step 2: Format the concatenation | |
The crt file should Follow the syntax | |
-----Start Certificate----- | |
############################ | |
############################ | |
-----End Certificate----- |
This file contains hidden or 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
info face="Arial-BoldMT" size=37 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=2,2 | |
common lineHeight=42 base=35 scaleW=128 scaleH=64 pages=1 packed=0 | |
page id=0 file="bitmap-font-sample-1.png" | |
chars count=11 | |
char id=32 x=103 y=33 width=0 height=0 xoffset=0 yoffset=34 xadvance=10 page=0 chnl=0 letter="space" | |
char id=48 x=86 y=2 width=19 height=29 xoffset=2 yoffset=5 xadvance=21 page=0 chnl=0 letter="0" | |
char id=49 x=88 y=33 width=13 height=28 xoffset=3 yoffset=6 xadvance=21 page=0 chnl=0 letter="1" | |
char id=50 x=46 y=33 width=19 height=28 xoffset=1 yoffset=6 xadvance=21 page=0 chnl=0 letter="2" | |
char id=51 x=23 y=2 width=19 height=29 xoffset=1 yoffset=5 xadvance=21 page=0 chnl=0 letter="3" | |
char id=52 x=2 y=33 width=21 height=28 xoffset=1 yoffset=6 xadvance=21 page=0 chnl=0 letter="4" |
This file contains hidden or 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
// | |
// FadeScrollView.swift | |
// | |
// Created by Luís Machado on 23/06/2017. | |
// Copyright © 2017 Luis Machado. All rights reserved. | |
// | |
import UIKit | |
class FadeScrollView: UIScrollView, UIScrollViewDelegate { |
NewerOlder