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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:Create*", | |
"logs:Describe*", | |
"logs:Get*", | |
"logs:Put*" | |
], |
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
const doc = require('dynamodb-doc'); | |
const dynamo = new doc.DynamoDB(); | |
const uuidv4 = require('uuid/v4'); | |
exports.handler = (event, context, callback) => { | |
// Callback to finish response | |
const done = (err, res) => callback(null, { | |
statusCode: err ? '400' : '204', | |
body: err ? err.message : '', |
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
emulator -avd AndroidEmulator -partition-size 1024 -writable-system | |
Install toot certificate from `http://ipv4.fiddler:8888` | |
The certificate will now be located in /data/misc/user/0/cacerts-added/. | |
Remount /system R/W as root if you haven't already (mount -o remount,rw /system). | |
adb shell |
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
// ==UserScript== | |
// @name SanFoundaryPractice | |
// @version 1 | |
// @grant GM_util | |
// @match https://www.sanfoundry.com/* | |
// @author SRKR | |
// ==/UserScript== | |
// Styles function - needs to be added in GM 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
#!/bin/bash | |
timestamp=`date "+%Y%m%d"` | |
source='/storage/source/' | |
target='/storage/target/' | |
exclude='folder' | |
diff --strip-trailing-cr --suppress-common-lines --ignore-case \ | |
--ignore-tab-expansion --ignore-trailing-space --ignore-space-change \ | |
--ignore-all-space --ignore-blank-lines \ |
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
// ==UserScript== | |
// @name SanFoundaryRemoveAds | |
// @version 1 | |
// @grant GM_util | |
// @match https://www.sanfoundry.com/* | |
// @author SRKR | |
// ==/UserScript== | |
// Styles function - needs to be added in GM 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
// JS array equivalents to C# LINQ methods - by Dan B. | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, | |
{ name: "Judy", age: 42 }, | |
{ name: "Tim", age: 8 } |
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
Linear gradient on line | |
<svg xmlns="http://www.w3.org/2000/svg" version="1"> <defs> <linearGradient id="e" x1="40" y1="235" x2="40" y2="265" gradientUnits="userSpaceOnUse"> <stop stop-color="steelblue" offset="0" /> <stop stop-color="red" offset="1" /> </linearGradient> </defs> <line x1="40" y1="210" x2="460" y2="290" stroke="url(#e)" stroke-width="30"/> </svg> | |
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
Resolve DNS | |
<link rel="dns-prefetch" href="//example.com"> | |
Resolve DNS and also make the TCP handshake and optional TLS negotiation | |
<link rel="preconnect" href="http://css-tricks.com"> | |
Fetch and store in cache, Definitely for webfont |
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
Note: The CSP report server should be on the same origin as the website, otherwise some browsers won't send the report. This can easily be achieved with a proxy. Here's an Nginx example: | |
location /csp-report { | |
rewrite ^(.*)$ / break; # Rewrite everything to just / | |
proxy_pass http://csp-report.herokuapp.com; | |
} | |
Ref: https://github.com/bu-ist/csp-report |