Skip to content

Instantly share code, notes, and snippets.

@artchen
artchen / search.html
Last active August 30, 2016 19:53
Universal Search Markup
<!-- Search Form -->
<form id="searchform" class="searchform" name="searchform">
<input type="text" class="search_input" />
<button type="submit" class="search-button">
<span class="icon icon-search"></span>
</button>
</form>
<!-- Search Result Modal -->
<div id="modal-search">
@artchen
artchen / search.less
Last active August 30, 2016 19:57
Universal Search Style
@material-red: #f44336;
@material-pink: #E91E63;
@material-purple: #9c27b0;
@material-deep-purple: #673ab7;
@material-indigo: #3f51b5;
@material-blue: #2196f3;
@material-teal: #009688;
@material-green: #4caf50;
@material-light-green: #8bc34a;
@material-orange: #ff9800;
@artchen
artchen / search-common.js
Last active September 20, 2016 03:54
Universal Search Common Logic
var SearchService = "";
(function($) {
/**
* A super class of common logics for all search services
* @param options : (object)
*/
SearchService = function(options) {
var self = this;
@artchen
artchen / google-custom-search-engine.js
Last active December 26, 2017 06:11
Universal Search Google Custom Search Engine
/**
* Search by Google Custom Search Engine JSON API
* @param options : (object)
*/
var GoogleCustomSearch = function(options) {
SearchService.apply(this, arguments);
var self = this;
var endpoint = "https://www.googleapis.com/customsearch/v1";
/**
@artchen
artchen / hexo-local-search.js
Last active September 1, 2016 03:17
Universal Search Hexo Local Search
/**
* Search by Hexo generator json content
* @param options : (object)
*/
var HexoSearch = function(options) {
SearchService.apply(this, arguments);
var self = this;
var endpoint = "/content.json";
self.cache = "";
@artchen
artchen / algolia-search.js
Last active September 1, 2016 16:14
Universal Search Algolia Search
/**
* Search by Algolia Search
* @param options : (object)
*/
var AlgoliaSearch = function(options) {
SearchService.apply(this, arguments);
var self = this;
var endpoint = "https://" +options.appId+ ".algolia.net/1/indexes/" +options.indexName;
/**
@artchen
artchen / azure-search.js
Created September 4, 2016 18:40
Universal Search Azure Search
/**
* Search by Azure Search API
* @param options : (object)
*/
var AzureSearch = function(options) {
SearchService.apply(this, arguments);
var self = this;
var endpoint = "https://" +self.config.serviceName+ ".search.windows.net/indexes/" +self.config.indexName+ "/docs?api-version=2015-02-28";
self.nav.current = 1;
@artchen
artchen / add-amex-offers.user.js
Last active March 15, 2024 01:50
Add AMEX Offers
// ==UserScript==
// @name Add AMEX offers
// @namespace http://tampermonkey.net/
// @version 2024-03-15
// @description - _-
// @author Art Chen
// @match https://global.americanexpress.com/offers/eligible
// @icon https://www.google.com/s2/favicons?sz=64&domain=americanexpress.com
// @grant none
// ==/UserScript==
@artchen
artchen / add-chase-offers.user.js
Last active October 20, 2024 19:06
Add Chase Offers
// ==UserScript==
// @name Add Chase offers
// @namespace http://tampermonkey.net/
// @version 2024-10-20
// @description - _-
// @author Art Chen
// @match https://secure.chase.com/web/auth/dashboard
// @icon https://www.google.com/s2/favicons?sz=64&domain=chase.com
// @grant none
// ==/UserScript==
@artchen
artchen / add-paypal-offers.user.js
Last active September 20, 2024 02:40
Add PayPal Offers
// ==UserScript==
// @name Add PayPal offers
// @namespace http://tampermonkey.net/
// @version 2024-04-02
// @description - _-
// @author Art Chen
// @match https://www.paypal.com/shopping*
// @match https://www.paypal.com/offers*
// @icon https://www.google.com/s2/favicons?sz=64&domain=paypal.com
// @grant none