Skip to content

Instantly share code, notes, and snippets.

View yonixw's full-sized avatar

Yehonatan Water Man yonixw

View GitHub Profile
@cutiko
cutiko / RestartAppAdb.md
Created July 3, 2019 17:23
Restart Android App using ADB

Remember to replace com.domain.appname with your actual app package name

adb shell am force-stop com.domain.appname
adb shell am start -n com.domain.appname/com.domain.appname.MainActivity
@Saphareas
Saphareas / README.md
Last active September 3, 2023 21:45
Psono to Bitwarden Import Script

Psono to Bitwarden Import Script

Psono to Bitwarden Import Script is a script for importing passwords/logins and secure notes from a Psono.pw export file into your Bitwarden vault.

This script requires Python 3 and the Bitwarden CLI client!

$ psono-importer.py [-p|--psonofile] <exported psono file>
Working set size: 196
Progress:-----------------------------------------------------------------| 0/196
@shospodarets
shospodarets / Chrome headless Puppeteer- capture DOM element screenshot using
Last active January 17, 2023 18:52
Chrome headless Puppeteer- capture DOM element screenshot using
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});
@adamstraube
adamstraube / rungit.sh
Last active December 14, 2022 12:41
Bash shell wrapper for running git-runner locally within WSL on a Windows 10 machine using Docker Desktop.
#!/usr/bin/env bash
if [[ $# -eq 0 ]]
then
echo "Usage: {up|down|runStages}"
exit 0
fi
PWD_RESOLVED="$(pwd -P)"
@binarycrayon
binarycrayon / policy.md
Created February 14, 2018 01:32 — forked from pgolding/policy.md
s3 bucket policy for presigned URLs generated by serverless lambda functions

AWS Presigned URLs

Presigned URLs are useful for fine-grained access control to resources on s3.

For example, if storing larger text blocks than DynamoDB might allow with its 400KB size limits s3 is a useful option.

Ignoring various ACL methods and using presigned URLs, it's possible to create lambda functions that can generate the required upload and download URLs.

Using the default IAM roles and lambda proxy configuration of serverless, lambdas are assigned an IAM role for the application (so that a logical group of functions can share resources - e.g. for a CRUD REST API). Each function then assumes the IAM role via its own function name.

@casamia918
casamia918 / node.js) ENOENT, no such file or directory when using fs.createWriteStream.md
Last active May 21, 2022 19:18
node.js) ENOENT, no such file or directory when using fs.createWriteStream

If you are facing the "ENOENT, no such file or directory" error message when using fs.createWriteStream, check your file name again.

In my case, the last character is not the last character of file name, but carrage return (\r)

I lost 3 hours to find this simple answer. So I leave this memo.

@PiotrCL
PiotrCL / StrictfpReflectionTest.java
Created September 20, 2016 10:38
Test class that detects how the strictfp modifier is propagated in different scenarios. The test is based on Java Reflection API
import java.lang.reflect.Modifier;
strictfp interface StrictInterface {
void someInterfaceMethod();
default void someInterfaceDefaultMethod() {}
class InnerTest {
public static void innerMethod() {}
@danielscholl
danielscholl / ieESC_disable
Created March 20, 2017 14:19
Disable IE Enhance Security PowerShell
function Disable-ieESC {
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}"
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0
Stop-Process -Name Explorer
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green
}
Disable-ieESC
@axiixc
axiixc / AXMutableOrderedDictionary.h
Created April 29, 2011 18:06
A mutable ordered dictionary collection for Objective-C.
@interface AXMutableOrderedDictionary : NSMutableDictionary <NSMutableCopying> {
@private
NSMutableArray * _keys;
NSMutableDictionary * _dict;
}
+ (id)newWithCapacity:(NSUInteger)initialCapacity;
+ (id)newWithOrderedDictionary:(AXMutableOrderedDictionary *)otherDictionary;
+ (id)newWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
@erkattak
erkattak / AndroidManifest.xml
Created June 19, 2017 18:47
Android Application Setup for use with Charles Proxy
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">