Skip to content

Instantly share code, notes, and snippets.

View srikanthlavudia's full-sized avatar

Srikanth Lavudia srikanthlavudia

  • Melbourne Australia
View GitHub Profile
@srikanthlavudia
srikanthlavudia / generate-pushid.js
Created April 19, 2019 17:52 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/

HTML5 Audio Player w/ Responsive Playlist

I changed this!

This is an HTML5 audio player that detects the user agent of your device/browser/OS and applies styling that matches the native audio player. The playlist responds to the width of your screen and features basic UI controls.

Feel free to fork this pen and add your own user agent styles for different browsers, devices and operating systems.

@srikanthlavudia
srikanthlavudia / wp-auto-login-single-user.php
Created July 26, 2016 09:36 — forked from cliffordp/functions.php
Automatically login a single WordPress user upon arrival to a specific page. Redirect to home page once logged in. Prevent viewing the login page. Tested with WP 3.9.1. Used in functions.php
<?php
//Automatically login a single WordPress user upon arrival to a specific page.
//Redirect to home page once logged in and prevent viewing of the login page.
//Tested with WP 3.9.1. Used in functions.php
//Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
//From http://tourkick.com/2014/wordpress-demo-multisite-db-reset/
function auto_login() {
//change these 2 items
$loginpageid = '1234'; //Page ID of your login page
@srikanthlavudia
srikanthlavudia / WordPress Youtube Playlist Widget.md
Last active September 10, 2015 13:49
WordPress Youtube Playlist Widget

This plugin loads the list of videos from a given plublic youtube playlist ID using google API. To get started: 1) Click the "Activate" link to the left of this description, 2) Create your Google API key, and 3) Go to https://www.youtube.com/ page, and get any public playlist that you like to show on the website sidebar and save to the widget configuration box.

Major features in WordPress Youtube Playlist Widget include:

  1. Automatically loads the list of videos based on the public Youtube Playlist ID once the configuration is stored into the widget box.

  2. When a particular video link is clicked by the user, they don't have to leave your website to watch the video, instead this plugin allows them to watch the video in a JQuery dialog box.

  3. After installing this plugin you can use the widget multiple times on multiple locations within the same page for showing different set of youtube videos by using different Youtube Playlist ID's.

  1. Download SourceGear DiffMerge: http://sourcegear.com/diffmerge/index.html

  2. Add the following to your global .gitconfig file:

     [diff]
         tool = DiffMerge
     [difftool "DiffMerge"]
         cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
     [merge]
    

tool = DiffMerge