Skip to content

Instantly share code, notes, and snippets.

@thetutlage
thetutlage / context.ts
Last active May 15, 2024 15:11
Unploy Server API Abstraction for AdonisJS
import Up from './index'
declare module '@ioc:Adonis/Core/HttpContext' {
interface HttpContextContract {
up: Up
}
}
@sharbel93
sharbel93 / stripe
Created July 17, 2019 13:33
Stripe Elements with Separate fields and brand logo
https://jsfiddle.net/ywain/L96q8uj5/
HTML
<script src="https://js.stripe.com/v3/"></script>
<body>
<form action="//httpbin.org/post" method="POST">
<input type="hidden" name="token" />
<div class="group">
<label>
@DarthSim
DarthSim / 00.imgproxy_vs_alternatives.md
Last active June 26, 2024 11:05
imgproxy vs alternatives benchmark

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
  • Ubuntu 18.04
  • Go 1.12
  • Python 2.7
  • Vips 8.7.4
@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@guycalledseven
guycalledseven / manual-uninstall-paragon-ntfs.sh
Last active July 10, 2024 21:30
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@rjz
rjz / ngrok_hostname.sh
Created August 9, 2016 16:20
Get ngrok hostname from command line
#!/bin/sh
# ngrok's web interface is HTML, but configuration is bootstrapped as a JSON
# string. We can hack out the forwarded hostname by extracting the next
# `*.ngrok.io` string from the JSON
#
# Brittle as all get out--YMMV. If you're still reading, usage is:
#
# $ ./ngrok_hostname.sh <proto> <addr>
#
@guiliredu
guiliredu / facebook-page-invite.js
Last active July 2, 2024 15:12
Facebook - Script to auto invite people who liked a page post do like the page
var buttons;
buttons = document.getElementsByClassName('_42ft');
for (var i = 0; i < buttons.length; i++) {
if(buttons[i].getAttribute('ajaxify') != null){
if(buttons[i].getAttribute('ajaxify').indexOf('invite') != -1){
buttons[i].click();
}
}
}
function setWeatherIcon(condid) {
var icon = '';
switch(condid) {
case '0': icon = 'wi-tornado';
break;
case '1': icon = 'wi-storm-showers';
break;
case '2': icon = 'wi-tornado';
break;
case '3': icon = 'wi-thunderstorm';
@scpurcell
scpurcell / Misc.java
Last active February 1, 2023 06:51
Java - using reflection to copy matching fields from one object to another
/**
* Use reflection to shallow copy simple type fields with matching names from one object to another
* @param fromObj the object to copy from
* @param toObj the object to copy to
*/
public static void copyMatchingFields( Object fromObj, Object toObj ) {
if ( fromObj == null || toObj == null )
throw new NullPointerException("Source and destination objects must be non-null");
Class fromClass = fromObj.getClass();
function setWeatherIcon(condid) {
var icon = '';
switch(condid) {
case '0': icon = 'wi-tornado';
break;
case '1': icon = 'wi-storm-showers';
break;
case '2': icon = 'wi-tornado';
break;
case '3': icon = 'wi-thunderstorm';