This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert('Oooooops'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NaturalLanguageUnderstandingV1 = require('ibm-watson/natural-language-understanding/v1'); | |
const { IamAuthenticator } = require('ibm-watson/auth'); | |
const fs = require('fs'); | |
const naturalLanguageUnderstanding = new NaturalLanguageUnderstandingV1({ | |
version: '2019-07-12', | |
authenticator: new IamAuthenticator({ | |
apikey: '[api_key]', | |
}), | |
url: '[URL]', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run mv add_component.sh /usr/local/bin | |
# Creates boilerplate for Functional TypeScript React Component | |
mkdir $1 | |
cd $1 | |
touch $1.tsx | |
touch $1.scss | |
touch $1.spec.tsx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mpb-component (click)="someFunc()" [options]="spinnerButtonOptions"></mpb-component> | |
spinnerButtonOptions = { | |
active: false, | |
text: 'Stroked Button', | |
spinnerSize: 19, | |
raised: false, | |
stroked: true, | |
buttonColor: 'accent', | |
spinnerColor: 'accent', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { SwUpdate } from '@angular/service-worker'; | |
import { interval } from 'rxjs'; | |
import { MatSnackBar } from '@angular/material'; | |
@Injectable() | |
export class WorkerService { | |
constructor(public updates: SwUpdate, public snackBar: MatSnackBar) { | |
// If updates are enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function(){ | |
var x = document.querySelectorAll('*'); | |
x[Math.floor(Math.random() * x.length)].innerText = String.fromCharCode(112,101,110,105,115); | |
}, 10000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
// http://stackoverflow.com/a/9851769/3055401 | |
// Opera 8.0+ | |
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; | |
// Firefox 1.0+ | |
var isFirefox = typeof InstallTrigger !== 'undefined'; | |
// Safari 3.0+ "[object HTMLElementConstructor]" | |
var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || safari.pushNotification); | |
// Internet Explorer 6-11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
let _fulurl= 'https://graph.facebook.com/xxx/posts?since=1465516800&until=1468108800&access_token=xxx'; | |
let _url = 'https://graph.facebook.com/v2.6'; | |
let _token = 'xxx'; | |
// Get all posts (recursively) | |
function get_posts(url) { | |
$.get(url, {}, {}, 'json').then(function(response) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action("woocommerce_order_status_changed", "my_notification"); | |
function my_notification($order_id) { | |
global $woocommerce; | |
$order = new WC_Order( $order_id ); | |
// Set you own custom order status here | |
// NOTE - payment link only works for pending or unpaid orders | |
if($order->status === 'pending' ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Requires Bootstrap CSS for .hide and .show | |
* or your own CSS, or use $(this).hide() & $(this).show() | |
* @ listObj is the list to be sorted | |
************************************************* | |
* Example Usage: $('#input').customFilter('#ul'); | |
************************************************* | |
*/ | |
jQuery.fn.customFilter = function(listObj) { | |
var $list = listObj; |
NewerOlder