Skip to content

Instantly share code, notes, and snippets.

View DevotionGeo's full-sized avatar
🏡
Working from home

Bangash DevotionGeo

🏡
Working from home
View GitHub Profile
@DevotionGeo
DevotionGeo / material-design-breakpoints.css
Created June 26, 2018 13:15 — forked from eyecatchup/material-design-breakpoints.css
CSS media queries based on the breakpoint guidance published by the Material Design team. http://www.google.com/design/spec/layout/adaptive-ui.html#adaptive-ui-breakpoint
/* Material Design Adaptive Breakpoints */
/*
Below you'll find CSS media queries based on the breakpoint guidance
published by the Material Design team. You can choose to use, customise
or remove these breakpoints based on your needs.
http://www.google.com/design/spec/layout/adaptive-ui.html#adaptive-ui-breakpoints
*/
/* mobile-small */
@DevotionGeo
DevotionGeo / getActiveMQ.js
Created June 27, 2017 03:59 — forked from aarongustafson/getActiveMQ.js
A simple way to track media query use in your JavaScript
// Get the active Media Query as defined in the CSS
// Use the following format:
// #getActiveMQ-watcher { font-family: "default"; }
// @media only screen and (min-width:20em){ #getActiveMQ-watcher { font-family: "small"; } }
// etc.
window.getActiveMQ = function() {
// Build the watcher
var $watcher = document.createElement('div'),
// alias getComputedStyle
computed = window.getComputedStyle,
<script>
// test for localStorage support
if(('localStorage' in window) && window['localStorage'] !== null){
var f = document.getElementById('mainform');
// test with PHP if the form was sent (the submit button has the name "sent")
<?php if(isset($_POST['sent']))){?>
// get the HTML of the form and cache it in the property "state"
localStorage.setItem('state',f.innerHTML);
<?php
/**
* Return the value for a key in an array or a property in an object.
* Typical usage:
*
* $object->foo = 'Bar';
* echo get_key($object, 'foo');
*
* $array['baz'] = 'Bat';
* echo get_key($array, 'baz');
$id='1227feacf41c472e5ee34e20b510a240ad81ea6e';
echo 'id '.$id."\n";
$url = 'http://example.com/activity/pub?id='.$id;
echo 'url '.$url."\n";
$data = array( 'foo' => 'bar' );
$data_json = json_encode($data);
echo $data_json."\n";