Skip to content

Instantly share code, notes, and snippets.

View verify.rb
# BTW, the value here is not empty
public_key = File.read(@public_key_path)
data = params.permit!
# Get the p_signature parameter & base64 decode it.
signature = Base64.decode64(data['p_signature'])
# Remove the p_signature parameter
data.delete('p_signature')
View facebook_purchase_event.js
((productId, productPrice) => {
'use strict';
window.fbq(
'track',
'Purchase', {
content_type: 'product_group',
content_ids: `[${productId}]`,
value: productPrice,
num_items: 1,
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background-color: #fff;
}
View sort-wanelo-products-by-saves.js
(function() {
'use strict';
const container = document.querySelector('.products-thumbnails.product-card-container, .products-grid');
const products = container.querySelectorAll('.product-card, .js-paginated-product.user-product-card');
const sortBySaves = Array.from(products).sort((productA, productB) => {
const savesA = productA.querySelector('.save-it.overlay-button .js-saves-count').innerText.replace(/[^\d+]+/gi, '');
const savesB = productB.querySelector('.save-it.overlay-button .js-saves-count').innerText.replace(/[^\d+]+/gi, '');
return savesA - savesB;
View only_display_facebook_ads.js
/**
* Only display Facebook Ads
* in your news feed
*/
const renderFacebookAds = () => {
'use strict';
const userPosts = document.querySelectorAll('[id*="hyperfeed_story_id"]');
Array.from(userPosts).map(userPost => {
View cool-text-shadow.css
.shadow {
text-shadow: #2f64af 1px 1px,#2f64af 2px 2px,#2f64af 3px 3px,#2f64af 4px 4px,#2f64af 5px 5px,#2f64af 6px 6px,#2f64af 7px 7px,#2f64af 8px 8px,#2f64af 9px 9px,#2f64af 10px 10px,#2f64af 11px 11px,#2f64af 12px 12px,#2f64af 13px 13px,#2f64af 14px 14px,#2f64af 15px 15px,#2f64af 16px 16px,#2f64af 17px 17px,#2f64af 18px 18px,#2f64af 19px 19px,#2f64af 20px 20px,#2f64af 21px 21px,#2f64af 22px 22px,#2f64af 23px 23px,#2f64af 24px 24px,#2f64af 25px 25px,#2f64af 26px 26px,#2f64af 27px 27px,#2f64af 28px 28px,#2f64af 29px 29px,#2f64af 30px 30px,#2f64af 31px 31px,#2f64af 32px 32px,#2f64af 33px 33px,#2f64af 34px 34px,#2f64af 35px 35px,#2f64af 36px 36px,#2f64af 37px 37px,#2f64af 38px 38px,#2f64af 39px 39px,#2f64af 40px 40px,#2f64af 41px 41px,#2f64af 42px 42px,#2f64af 43px 43px,#2f64af 44px 44px,#2f64af 45px 45px,#2f64af 46px 46px,#2f64af 47px 47px,#2f64af 48px 48px,#2f64af 49px 49px,#2f64af 50px 50px,#2f64af 51px 51px,#2f64af 52px 52px,#2f64af 53px 53px,#2f64af 54px 54px,#2f64af 55px 55px,#2f64af 56px 56px,#2f64af 5
View wish-follow-script.js
(function() {
'use strict';
if ( location.pathname !== "/p/PRODUCT-ID HERE/savers" ) {
return false;
}
function rand_between( num1, num2 ) {
return Math.floor(Math.random() * num2) + num1;
View epacket.js
(function() {
'use strict';
if ( !$('#narrow-form').length ) {
return false;
}
var markup = `
<img src="http://i00.i.aliimg.com/wimg/buyer/single/icon-ems.jpg" style="border: 3px solid #6FFF96; position: absolute; z-index: 0; width: 55px;" />
View .git-completion.bash
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
You can’t perform that action at this time.