Skip to content

Instantly share code, notes, and snippets.

View erropix's full-sized avatar
💭
I may be slow to respond.

Abdelouahed E. erropix

💭
I may be slow to respond.
View GitHub Profile
@ethaizone
ethaizone / server_time_sync.js
Last active December 16, 2022 12:37
Sync server time to client browser with JS. Implement follow Network Time Protocol.
// Thanks http://stackoverflow.com/questions/1638337/the-best-way-to-synchronize-client-side-javascript-clock-with-server-date
var serverTimeOffset = false;
function getServerTime(callback) {
if (serverTimeOffset === false) {
var scripts = document.getElementsByTagName("script"),
URL = scripts[scripts.length - 1].src;
var clientTimestamp = Date.parse(new Date().toUTCString());
@matiskay
matiskay / widget-skeleton.php
Created December 14, 2011 19:22
Wordpress Widget Skeleton
<?php
class Widget_Name extends WP_Widget {
function Widget_Name() {
$widget_opts = array(
'classname' => 'your-awesome-class',
'description' => 'Your awesome Description',
);