Skip to content

Instantly share code, notes, and snippets.

View gtaing1's full-sized avatar

Gigi Taing gtaing1

View GitHub Profile
@gtaing1
gtaing1 / newsletter-popup.js
Created December 2, 2021 02:11 — forked from vanpariyar/newsletter-popup.js
Newsletter popup with session storage
if (typeof(Storage) !== "undefined") {
// Store
function showPopup(){
window.setTimeout(function () {
$('#newsletter-modal').modal('show');
sessionStorage.setItem("popup", 'hide');
},6000);
}
if( !sessionStorage.getItem("popup")){
sessionStorage.setItem("popup", 'show');
@gtaing1
gtaing1 / response-header.js
Created May 1, 2018 13:36 — forked from thsutton/response-header.js
Get the value of an HTTP response header in JavaScript
/**
* Read the value of a header in the current document.
*
* This uses a [single] XMLHTTPRequest to do a HEAD of the current document
* and fetch HTTP response header values. Note that the implementation is
* rather stupid in that it spins waiting for the XMLHTTPRequest to complete
* if it hasn't been called yet.
*
* @param name string
@gtaing1
gtaing1 / test.js
Created July 23, 2017 03:32 — forked from markkernke/test.js
Tableau JS API usage for Syncing Metric Names between datasources
/**********************************************************
*
* Currently does not work due to http://community.tableau.com/thread/131070
*
*********************************************************/
var viz = tableau.VizManager.getVizs()[0]
@gtaing1
gtaing1 / angular-tableau.js
Created July 12, 2017 20:12 — forked from faustomorales/angular-tableau.js
Angular directive to embed Tableau dashboards
/* Using this directive is as easy as 1, 2, 3.
1. Grab the Tableau API JavaScript library as well as this module.
a. <script src="path/to/tableau-2.0.0.min.js"></script>
b. <script src="path/to/angular-tableau.js"></script>
2. Import the module into your app by adding 'angular-tableau' to your dependencies.
3. Use the directive like this:
<tableau-viz height="'500px'"
url="path/to/tableau-dashboard"
filters={'field1':['item1', 'item2'], 'dateField':{'min':startDate, 'max':endDate}}">
</tableau-viz>
@gtaing1
gtaing1 / BB_Assets
Last active May 9, 2017 22:16 — forked from johnlix1/BB_Assets
Product Cards - Mobile
<div class="celtra-ad-v3">
<!-- externalCreativeId = raw %ecid! -->
<!-- externalPlacementId = raw %epid! -->
<!-- externalSiteId = raw %esid! -->
<!-- externalLineItemId = raw %eaid! -->
<img src="data:image/png,celtra" style="display: none" onerror="
(function(img) {
var params = {'expandDirection':'undefined','preferredClickThroughWindow':'new','clickUrl':'%c','clickEvent':'advertiser','externalAdServer':'DBM','tagVersion':'4'};
@gtaing1
gtaing1 / TransitionLinkedIssues
Created April 19, 2016 22:44 — forked from utopius/TransitionLinkedIssues
JIRA Script Runner groovy post-function which transitions linked issues with the given link type to the given step.Still needs some improvement.Put into atlassian-jira\WEB-INF\classes\com\onresolve\jira\groovy\canned\workflow\postfunctionsTo update you may have to edit a workflow transition -> add postfunction -> select ResolveLinkedIssues. This…
package com.onresolve.jira.groovy.canned.workflow.postfunctions
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.util.ErrorCollection
import com.onresolve.jira.groovy.canned.CannedScript
import com.onresolve.jira.groovy.canned.utils.CannedScriptUtils
@gtaing1
gtaing1 / BarQ-1.js
Last active January 3, 2016 06:26 — forked from anonymous/BarQ-1.js
https://repl.it/BarQ/1 created by Gereltuya
var totthree=0;
var totfive=0;
var a = 3983;
var dtotal=0;
for (var b=3; b<990; b++) {
if (b%3===0) {