Skip to content

Instantly share code, notes, and snippets.

View sorabh86's full-sized avatar

Sorabh (SOS) sorabh86

View GitHub Profile
add_action('admin_init', 'create_metabox');
function create_metabox() {
add_meta_box(
'stock-data', //id
'Stock Data', //title
array($this, 'add_metabox_stock_image_data_content'), //callback
'stock_image', //screen
'normal', //context
'default', //priority
<script type="text/javascript">
function GetCardType(number)
{
// visa
var re = new RegExp("^4");
if (number.match(re) != null)
return "Visa";
// Mastercard
re = new RegExp("^5[1-5]");
@sorabh86
sorabh86 / Default.sublime-theme
Created March 2, 2017 08:41 — forked from MrDrews/Default.sublime-theme
Solarized (light) -- Complement the stock Solarized (light) theme in sublime text 3 by placing this `Default.sublime-theme` inside the `Packages/User` folder. It will recolor the sidebar.
[
{
"class": "sidebar_container",
// $base02: #073642
"layer0.tint": [7,54,66],
"layer0.opacity": 1.0,
"layer0.draw_center": false,
"layer0.inner_margin": [0, 0, 1, 0],
"content_margin": [0, 0, 1, 0]
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@sorabh86
sorabh86 / font-awesome-tag.sublime-snippet
Last active January 2, 2016 03:19
font-awesome-tag-html
<snippet>
<content><![CDATA[
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css">
]]></content>
<tabTrigger>font-awesome</tabTrigger>
<scope>text.html</scope>
<description>BootStrap Font-awesome</description>
</snippet>
<snippet>
<content><![CDATA[
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
function initialize() {
var map_canvas = document.getElementById('map_canvas');
var map_options = {
center: new google.maps.LatLng(44.5403, -78.5463),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
@sorabh86
sorabh86 / Jquery-google-fallback.sublime-snippet
Created November 26, 2013 18:03
Javascript: jquery google fallback Html tag
<snippet>
<content><![CDATA[
<!-- include extern jQuery file but fall back to local file if extern one fails to load !-->
<script src="http://code.jquery.com/jquery-${1:1.10.2}.min.js"></script>
<script type="text/javascript">window.jQuery || document.write('<script type="text\/javascript" src="js\/${1:1.10.2}.jquery.min"><\/script>')</script>
]]></content>
<tabTrigger>gjf</tabTrigger>
<scope>text.html</scope>
<description>Jquery/google-fallback</description>
</snippet>
@sorabh86
sorabh86 / html5-media-query.sublime-snippet
Created November 26, 2013 12:01
Html5: media query for devices
<snippet>
<content><![CDATA[
<!-- Phone -->
<link href="${1:phone-style.css}" rel="stylesheet" type="text/css" media="only screen and (max-width:320px)">
<!-- Tablet -->
<link href="${2:tablet-style.css}" rel="stylesheet" type="text/css" media="only screen and (min-width:321px) and (max-width:768px)">
<!-- Desktop -->
<link href="${3:style.css}" rel="stylesheet" type="text/css" media="only screen and (min-width:769px)">
]]></content>
<tabTrigger>mq</tabTrigger>
@sorabh86
sorabh86 / html5-tags-support.sublime-snippet
Created November 26, 2013 08:32
HTML5: support for html5 tags in ie
<snippet>
<content><![CDATA[
<!--[if lt IE 9]> HTML5Shiv
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
]]></content>
<tabTrigger>html5shiv</tabTrigger>
<scope>text.html</scope>
<description>tag support(ie9)</description>
</snippet>