Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / App.js
Last active May 12, 2021 10:45
React drag and drop full screen
import React, { Component } from 'react'
import DragAndDrop from './DragAndDrop'
class App extends Component {
handleDrop(files) {
console.log(files)
}
render() {
return (
@LoganGray
LoganGray / chromeinstall_ubu16.sh
Last active June 6, 2023 14:35
this worked to install selenium and google chrome on my Ubuntu 16 server.
#!/usr/bin/env bash
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, 18.04, 20.04.1 LTS desktop, Jan 2021
# also tested and works on Elem OS 5.1 :)
#
# make sure script is run as root or sudo
if [[ $(whoami) != "root" ]] ; then
echo ; echo "This script, $0, SHOULD be run as ROOT. " ; echo
exit 1
fi
#
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active November 16, 2024 20:24
crack activate Office on mac with license file
@enricofoltran
enricofoltran / main.go
Last active October 3, 2024 14:08
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@kennwhite
kennwhite / https.go
Last active December 24, 2023 22:06
Simple https http/2 static web server with HSTS & CSP (A+ SSLLabs & securityheaders.io rating) in Go using LetsEncrypt acme autocert
package main
import (
"crypto/tls"
"golang.org/x/crypto/acme/autocert"
"log"
"net"
"net/http"
)
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active November 13, 2024 15:50
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@glaucocustodio
glaucocustodio / Default.sublime-theme
Created January 5, 2015 16:30
Increase font size and row padding from Sublime Text 3's sidebar
// for the ST3 users who don't have the Default.sublime-theme file (which is actually the default configuration),
// the simplest procedure is:
// 1- Navigate to Sublime Text -> Preferences -> Browse Packages
// 2- Open the User directory
// 3- Create a file named Default.sublime-theme with the following content (modify font.size as required):
[
{
"class": "sidebar_label",
"color": [0, 0, 0],
"font.size": 16
@udnisap
udnisap / rate_limit.js
Last active November 9, 2019 16:49 — forked from epogue/rate_limit.js
This will make sure(most of the times) the concurrent invocation is handled
/* Extend the Underscore object with the following methods */
// Rate limit ensures a function is never called more than every [rate]ms
// Unlike underscore's _.throttle function, function calls are queued so that
// requests are never lost and simply deferred until some other time
//
// Parameters
// * func - function to rate limit
// * rate - minimum time to wait between function calls
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request
@mikezila
mikezila / govatar.go
Created August 6, 2014 21:25
Govatar - Avatar generator in Golang
// govatar.go
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"math/rand"
"os"
@pbojinov
pbojinov / README.md
Last active November 5, 2024 03:29
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe