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(){ | |
var db; | |
var dbname = 'todos'; | |
openDatabase(function() { | |
console.log('db connected!'); | |
getTodo(); | |
}); | |
function openDatabase(callback){ | |
var version = 1; |
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 | |
/** | |
* Social Media Customizer | |
*/ | |
add_action( "customize_register", "sparq_social_media_customizer" ); | |
function sparq_social_media_customizer( $wp_customize ) { | |
// Declare Sidebar option |
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 | |
// 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 |
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
<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"); |
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 | |
/* | |
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) |