Skip to content

Instantly share code, notes, and snippets.

View rodrigograca31's full-sized avatar
👨‍💻
Professional 🐛 solver

Rodrigo Graça rodrigograca31

👨‍💻
Professional 🐛 solver
View GitHub Profile
var userInput = JSON.parse('{"__proto__": {"admin": true}}')
var a = {...userInput}
console.log(a.admin)
// true
var b = Object.assign({}, userInput)
console.log(b.admin)
// true
@niahoo
niahoo / delete-all-messages.js
Last active September 20, 2023 01:29
Delete all messages in a Discord channel
(function(){
// Paste your token between the quotes :
var authToken = '________________________________________'
// https://github.com/yanatan16/nanoajax
!function(t,e){function n(t){return t&&e.XDomainRequest&&!/MSIE 1/.test(navigator.userAgent)?new XDomainRequest:e.XMLHttpRequest?new XMLHttpRequest:void 0}function o(t,e,n){t[e]=t[e]||n}var r=["responseType","withCredentials","timeout","onprogress"];t.ajax=function(t,a){function s(t,e){return function(){c||(a(void 0===f.status?t:f.status,0===f.status?"Error":f.response||f.responseText||e,f),c=!0)}}var u=t.headers||{},i=t.body,d=t.method||(i?"POST":"GET"),c=!1,f=n(t.cors);f.open(d,t.url,!0);var l=f.onload=s(200);f.onreadystatechange=function(){4===f.readyState&&l()},f.onerror=s(null,"Error"),f.ontimeout=s(null,"Timeout"),f.onabort=s(null,"Abort"),i&&(o(u,"X-Requested-With","XMLHttpRequest"),e.FormData&&i instanceof e.FormData||o(u,"Content-Type","application/x-www-form-urlencoded"));for(var p,m=0,v=r.length;v>m;m++)p=r[m],void 0!==t[p]&&(f[p]=t[p]);for
@netmagik
netmagik / enable HSTS
Last active May 22, 2017 21:43
Enable HSTS - HTTP Strict Transport Security in .htaccess
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
</IfModule>
@joepie91
joepie91 / vpn.md
Last active May 19, 2024 05:21
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@peteygao
peteygao / Cordova for iOS
Last active February 21, 2021 23:57
Step by Step guide to installing Cordova for iOS development
1. Install Xcode, if you haven't already.
a. Once installed, run Xcode and accept the license agreement.
b. Go into Xcode Prefs (Cmd + ,), go to Downloads, and install "Command Line Tools for Xcode" (or something named similarily)
2. Install Homebrew (copy and paste the following into your terminal):
```bash
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@ghalusa
ghalusa / gist:5485982
Last active February 25, 2020 21:48
Install node.js on a raspberry pi
wget http://nodejs.org/dist/v0.10.5/node-v0.10.5-linux-arm-pi.tar.gz
cd /usr/local
sudo tar xzvf ~/node-v0.10.5-linux-arm-pi.tar.gz --strip=1
vi ~/.bash_aliases
export PATH=$PATH:/usr/local/bin/node
bash
node -v
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php