Skip to content

Instantly share code, notes, and snippets.

View hemnathmouli's full-sized avatar
🕸️
Converting Coffee -> Code

Hemnath Mouli hemnathmouli

🕸️
Converting Coffee -> Code
View GitHub Profile
@hemnathmouli
hemnathmouli / app.js
Created August 2, 2020 12:08
Todo app with IndexedDB
(function(){
var db;
var dbname = 'todos';
openDatabase(function() {
console.log('db connected!');
getTodo();
});
function openDatabase(callback){
var version = 1;
<?php
/**
* Social Media Customizer
*/
add_action( "customize_register", "sparq_social_media_customizer" );
function sparq_social_media_customizer( $wp_customize ) {
// Declare Sidebar option
@hemnathmouli
hemnathmouli / gist:03a39d334d5007c716e2df4bfad5db1f
Created March 3, 2018 22:08 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@hemnathmouli
hemnathmouli / sandbox.html
Created March 1, 2017 10:28
How to create a random color variable with Javascript and HTML?
<html>
<head>
<title>Random Background</title>
<script>
setInterval(function(){
var x = Math.round( Math.random() * 255 );
var y = Math.round( Math.random() * 255 );
var z = Math.round( Math.random() * 255 );
var bg = "background:rgb("+x+", "+y+", "+z+");";
var element = document.getElementById("random-background");
@hemnathmouli
hemnathmouli / monitor.php
Created September 16, 2016 23:48 — forked from jesobreira/monitor.php
Server Monitor
<?php
/*
The aim is to create a functional server monitor based on the one
showed on Mark Zuckerberg's monitor on The Social Network movie.
Run so:
php monitor.php
Notes:
- The server LogFormat must be "Common Log Format" (%h %^[%d:%^] "%r" %s %b)