Skip to content

Instantly share code, notes, and snippets.

@xxxxlr
xxxxlr / React-Native-WebView-Cookies.js
Created July 27, 2017 01:10 — forked from kanzitelli/React-Native-WebView-Cookies.js
React Native Trick: Get Cookies of WebView without using any native modules such as react-native-cookies. Might be helpful for getting JWT while making OAuth2 👽
// @flow
import React, { Component } from 'react';
import {
WebView,
} from 'react-native';
class LoginScreen extends Component {
state = {
cookies : {},
@kellyrmilligan
kellyrmilligan / s3Sync.sh
Created June 8, 2017 13:38
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@etagwerker
etagwerker / minimum_rights_policy.json
Created May 10, 2017 14:30 — forked from clemens/minimum_rights_policy.json
Minimum rights policy for S3 that works just fine with CarrierWave/Fog
{
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket" ],
"Resource": [ "arn:aws:s3:::BUCKETNAME" ]
},
{
"Effect": "Allow",
"Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:PutObjectAcl"],
@vip3rc0de
vip3rc0de / StopW10.bat
Last active February 20, 2024 12:57
This Bat will stop windows 10 spying you, also it will Uninstall OneDrive....So you will keep your privacy! This bat will Disable Data Logging Services, will Configure Windows Explorer, Uninstall OneDrive and edit Hosts to stop sending Telemetry Data to Microsoft!
@echo off
echo ***************************************************************
echo ***************************************************************
echo *** This Script will stop Windows 10 Spying you...YEYYYY!!! ***
echo ***************************************************************
echo *** We will Disable Data Logging Services ***
echo *** We will Configure Windows Explorer ***
echo *** We will Uninstall OneDrive ***
echo *** We will edit Hosts to stop sending Data to Microsoft ***
echo ***************************************************************
@danilop
danilop / gist:d4ff43835e469043e95e
Last active August 7, 2020 09:29
Amazon S3 redirection rule to send every "miss" (HTTP 404) to the domain root
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<HostName>danilop.net</HostName>
<ReplaceKeyWith/>
</Redirect>
</RoutingRule>
@clemens
clemens / minimum_rights_policy.json
Created September 5, 2014 09:39
Minimum rights policy for S3 that works just fine with CarrierWave/Fog
{
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket" ],
"Resource": [ "arn:aws:s3:::BUCKETNAME" ]
},
{
"Effect": "Allow",
"Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject"],
@masak
masak / explanation.md
Last active April 11, 2024 02:50
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.