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
// Listen for messages | |
sse.addEventListener("channel-name", function(e) { | |
console.log(e.data) | |
}) | |
// Listen for messages | |
socket.addEventListener("channel-name", function (event) { | |
console.log("Message from server", event.data); | |
}); |
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
// addEventListener version | |
evtSource.addEventListener("open", (e) => { | |
console.log("The connection has been established."); | |
}); | |
// onopen version | |
evtSource.onopen = (e) => { | |
console.log("The connection has been established."); | |
}; | |
// Connection opened | |
socket.addEventListener("open", (event) => { |
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 sse = new EventSource('/api/v1/sse'); | |
const socket = new WebSocket('ws://localhost:8080/api/v1/socket'); |
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
// collection pre-request script | |
// obtain parameters from collection configuration | |
const domain = pm.environment.get("auth0_domain"); | |
const client_id = pm.environment.get("auth0_client_id"); | |
const audience = pm.environment.get("auth0_audience"); | |
const client_secert = pm.environment.get("auth0_client_secret"); | |
const username = pm.environment.get("username"); | |
const password = pm.environment.get("password"); |
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
#!/usr/bin/env bash | |
if [ -z ${WPCONFIG+x} ]; then WPCONFIG=/Users/amit/.wpconfig; fi | |
THEMENAME="${PWD##*/}" | |
getDefualtValues(){ | |
echo "getting defualt values..." | |
if [ -f "$WPCONFIG" ]; then | |
source "$WPCONFIG" | |
else | |
echo "Please create and set your WPCONFIG file on ${WPCONFIG} or change path by WPCONFIG varible" |
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 get_header(); ?> | |
<?php | |
global $post; | |
$slug; | |
if (is_front_page()) { | |
$slug = "front"; | |
} else if (file_exists(locate_template('partials/content-' . $post->post_name . '.php'))) { | |
$slug = $post->post_name; | |
} else { |
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
(function($) { | |
// define easeInOutQuint | |
$.easing.jswing = $.easing.swing; | |
$.extend($.easing, { | |
easeInOutQuint: function(x, t, b, c, d) { | |
if ((t /= d / 2) < 1) return (c / 2) * t * t * t * t * t + b; | |
return (c / 2) * ((t -= 2) * t * t * t * t + 2) + b; | |
} |
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
var ss = SpreadsheetApp.getActiveSheet(); | |
var lastRow = ss.getLastRow(); | |
// my table col where: timestemp, amount, diff, donorsNum, donors name | |
var MONEYCOL = 2; | |
var DonorsCOL = 4; | |
function parseHtml(searchString){ | |
var url = ''; //this is the roject URL. tested on www.giveback.co.il, should probebly work on https://headstart.co.il/ with minor changes | |
var html = UrlFetchApp.fetch(url).getContentText(); |
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 | |
/* ====================================================== | |
This script is NOT FULLY TESTED (not tested on Windows Server either) | |
USE AT YOUR OWN RISK - development environment Ubuntu Linux 14.04.3 LTS | |
The purpose of this script is for small websites and blogs | |
to have their existing media to work through Amazon S3 | |
There's a great plugin, WP Offload S3, that we'll be tapping | |
into...it works great for new media, but this is a quick |
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 | |
wpCLI=`wp` | |
if [ "$wpCLI" = "" ] | |
then | |
echo "WP-cli does not exist on this system." | |
# exit 1 | |
fi | |
wp plugin list | tr -d '|' | grep 'active' | cut -f 1,4 | awk ' BEGIN { ORS = ""; print "plugins: {"; } { print "\/\@"$1"\/\@" " : " "\/\@"$2"\/\@"; } END { print "},"; }' | sed "s^\"^\\\\\"^g;s^\/\@\/\@^\",\"^g;s^\/\@^\"^g" > pluginss.json |