Skip to content

Instantly share code, notes, and snippets.

😎
Developing new chat platform

screets screets

😎
Developing new chat platform
Block or report user

Report or block screets

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Repox
Repox / send.php
Created Apr 12, 2018
Google API PHP Client - Firebase Cloud Messaging Service v1 example
View send.php
<?php
/**
* This serves as an example of how to use the Google API PHP Client
* with Firebase Cloud Messaging Service.
*
* The client can be found here:
* https://github.com/google/google-api-php-client
*
* At the time of writing this, there's no Service object for the correct
View blink.css
@carlodaniele
carlodaniele / food-example-plugin.php
Last active Mar 29, 2019
An example plugin for WPMU DEV readers
View food-example-plugin.php
<?php
/**
* @package Food_example_plugin
* @version 1.0
*/
/*
Plugin Name: Food example plugin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for WPMU DEV readers
Author: Carlo Daniele
@jeffdonthemic
jeffdonthemic / app.js
Created Jul 7, 2014
Simple socket.io example
View app.js
var http = require('http'),
fs = require('fs'),
// NEVER use a Sync function except at start-up!
index = fs.readFileSync(__dirname + '/index.html');
// Send index.html to all requests
var app = http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(index);
});
@mudge
mudge / eventemitter.js
Last active Oct 15, 2019
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
View eventemitter.js
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@anantn
anantn / firebase_detect_data.js
Created Dec 18, 2012
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
View firebase_detect_data.js
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
@wildlyinaccurate
wildlyinaccurate / event.js
Last active Aug 20, 2019
Really simple Javascript custom event system
View event.js
var Event = function() {
var self = this;
self.queue = {};
self.fired = [];
return {
fire: function(event) {
@chrisvanpatten
chrisvanpatten / README.md
Created Mar 7, 2012
WordPress Admin Tabs
View README.md

Huh?

Believe it or not, WordPress doesn't have a fully-fleshed out common tab style for plugins or theme authors to use in metaboxes.

The style exists for categories, but it hasn't been fully adapted for the half-complete wp-tab setup. Trac ticket #17959 has a solution that not only fleshes the style but it also adds a global JavaScript file to give the wp-tab HTML some action. Until that ticket is accepted into core, this Gist adapts that code so it's available to use independently in your theme or plugin.

How?

Just enqueue the CSS and JavaScript in the admin_enqueue_scripts script hook and drop the tab HTML in a metabox. It will automatically adapt to the normal and side column widths, much like category tabs.

@joelambert
joelambert / README
Created Jun 1, 2011
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
View README
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
You can’t perform that action at this time.