Skip to content

Instantly share code, notes, and snippets.

@jeffhuangtw
jeffhuangtw / sample.js
Created March 15, 2017 09:52
[nodejs] server side check "androidpublisher.purchases.subscriptions.get" with "service account"
// Google Play API Key
// ref: http://stackoverflow.com/questions/35127086/android-inapp-purchase-receipt-validation-google-play
// ref: https://developers.google.com/android-publisher/authorization
// ref: http://google.github.io/google-api-nodejs-client/18.0.0/index.html#toc14__anchor
//
// install npm package
// ref: https://github.com/google/google-api-nodejs-client
// $ npm install googleapis --save
//
const google = require('googleapis');
@Yimiprod
Yimiprod / difference.js
Last active May 10, 2024 16:49
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@martindrapeau
martindrapeau / Backgrid.ClientSideFilterWithPickFilter
Created March 27, 2014 16:50
Extend Backgrid ClientSideFilter with a pick filter, to pre-filter data set. Useful to combine text search with a select, checkboxes or radio buttons filters.
// Subclass Backgrid Filter to pass an extra 'pick' filter
Backgrid.ClientSideFilterWithPickFilter = Backgrid.Extension.ClientSideFilter.extend({
pickFilter: null,
setPickFilter: function (attrs) {
this.pickFilter = attrs;
this.search();
return this;
},
makeMatcher: function (query) {
@martindrapeau
martindrapeau / jquery.cach-inputs.js
Created December 27, 2013 02:36
jQuery plugin to cache HTML inputs using local storage. Restores them upon next page load.
// Cache user inputs into HTML5 local storage. Restore them upon next page load.
// Usage:
// $('body').CacheInputs();
//
// Will store stringified JSON in local storage, against the key you specify
// or 'cache-inputs' if you omit it. See settings below.
//
// Author: Martin Drapeau
//
// Greatly inspired from Johnathan Schnittger
@afeld
afeld / gist:5201086
Last active August 17, 2023 18:43
job boards
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 2, 2024 22:59
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@jonathonbyrdziak
jonathonbyrdziak / Instructions
Created October 10, 2011 08:02
The perfect magento installation on CentOS 6
#
# @author Jonathon byrd
#
############################################################
# first things first, set your iptables for a web server. If you jack these
# up you don't want to have to re-install your os after doing much more.
# @see http://www.thegeekstuff.com/2011/06/iptables-rules-examples/
# and
# @see https://help.ubuntu.com/community/IptablesHowTo
@alexdunae
alexdunae / wordpress_custom_post_gallery.php
Created March 31, 2011 23:55
Display a custom post type's media library inline on the WordPress edit page screen
<?php
define('MY_POST_TYPE', 'my');
define('MY_POST_SLUG', 'gallery');
function my_register_post_type () {
$args = array (
'label' => 'Gallery',
'supports' => array( 'title', 'excerpt' ),
'register_meta_box_cb' => 'my_meta_box_cb',
@jonathonbyrdziak
jonathonbyrdziak / SMS.php
Created August 18, 2010 20:35
SMS for PHP :: Thanks to webtechnick, I'll just track this here.
/***************************************************
* Sms Component
*
* Send SMS messages just like you would the Email component.
*
* @copyright Copyright 2009, Webtechnick
* @link http://www.webtechnick.com
* @author Nick Baker
* @version 1.0
* @license MIT
@jonathonbyrdziak
jonathonbyrdziak / .htaccess protection
Created August 12, 2010 19:37
htaccess Security :: A compilation of .htaccess commands to make your website more secure.
## Copyright (c) 2007, 2012 All Right Reserved, Red Rokk, inc
##
## THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
## KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
## IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
## PARTICULAR PURPOSE.
##
## Author: Jonathon Byrd
## Email: jonathon@redrokk.com