Skip to content

Instantly share code, notes, and snippets.

Avatar

Penn Su pencilcheck

View GitHub Profile
View gist:55aacbf0f523119a225fae4c3cf9fdb9
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.10.0, 0.99.99]'
}
}
View gist:e7276b13a5526d52c7745b3c36e87da3
// https://documentation.onesignal.com/reference#create-notification
var request = require('request');
var Promise = require("bluebird");
// email, templateId are required
module.exports = async function (email, templateId, payload) {
var message = '', heading = '', subtitle = '';
var restKey = process.env.ONE_SIGNAL_REST_KEY;
var appID = process.env.ONE_SIGNAL_APP_ID;
View gist:d4cf17590430ec639db596e41c36d831
apply plugin: 'com.android.application'
ext {
supportlib_version = '23.3.0'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
View gist:ed4a4a3ab5f9e2228c5772df1c8a901a
Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location '/usr/local/Cellar/android-sdk/24/add-ons/addon-google_apis-google-19-1' (Expected '/usr/local/Cellar/android-sdk/24/add-ons/addon-google_apis-google-19')
Already observed package id 'add-ons;addon-google_apis-google-19' in '/usr/local/Cellar/android-sdk/24/add-ons/addon-google_apis-google-19'. Skipping duplicate at '/usr/local/Cellar/android-sdk/24/add-ons/addon-google_apis-google-19-1'
Observed package id '..;..;..;var;lib;android-sdk;samples;android-15' in inconsistent location '/usr/local/Cellar/android-sdk/24/samples/android-15' (Expected '/usr/local/Cellar/android-sdk/24/../../../var/lib/android-sdk/samples/android-15')
Observed package id '..;..;..;var;lib;android-sdk;samples;android-17' in inconsistent location '/usr/local/Cellar/android-sdk/24/samples/android-17' (Expected '/usr/local/Cellar/android-sdk/24/../../../var/lib/android-sdk/samples/android-17')
Observed package id '..;..;..;var;lib;android-sdk;samples;androi
View auto resizer
module.exports = function extend($) {
$.fn.autoSizr = function(options) {
var el, elements, _i, _len, _results
elements = $(this)
if (elements.length < 0) {
return
}
_results = []
for (_i = 0, _len = elements.length; _i < _len; _i++) {
el = elements[_i]
View gist:cb71850937c0341a9b06a7f8fdee14fd
module.exports = function PgConnectionArgFilter(
builder,
{ pgInflection: inflection }
) {
builder.hook(
"init",
(
_,
{
addType,
@pencilcheck
pencilcheck / autoSizr.js
Created Jul 10, 2017 — forked from iamkirkbater/autoSizr.js
Simple jQuery Plugin that auto resizes text to fill a specific sized div (great for responsive slideshows that utilize large banner text with variable lengths), derived from https://gist.github.com/iam4x/5015270
View autoSizr.js
$.fn.autoSizr = function () {
var el, elements, _i, _len, _results;
elements = $(this);
if (elements.length < 0) {
return;
}
_results = [];
for (_i = 0, _len = elements.length; _i < _len; _i++) {
el = elements[_i];
_results.push((function(el) {
View gist:6761a6a0fb8ae1c840052c5bd471df1d
var itemCount = getCookie("itemCount");
if (itemCount !== "") {
$(".cart").text("(" + itemCount + ")");
}
function addToCart(btn, itemCode) {
addToCartApi(btn, itemCode);
View gist:07367be32f528e52ce0d97b834474b93
module.exports = {
webpack: (config) => {
config.module.rules.push(
// yaml
{
test: /\.yaml$/,
use: [
{
loader: 'emit-file-loader',
options: {
View gist:311f32cad0deadfcb985
AttendeeSchema = new Schema(
user_id:
type: Schema.Types.ObjectId
ref: 'User'
event_id:
type: Schema.Types.ObjectId
ref: 'Event'
like:
type: Boolean
default: false
You can’t perform that action at this time.