Skip to content

Instantly share code, notes, and snippets.

View m-pokrovskii's full-sized avatar

Maxim Pokrovskii m-pokrovskii

View GitHub Profile
service.notifications
  .create({
        toBinding: bindings,
        body: message,
sms: {
status_callback: 'https://peppernet.serveo.net/admin/twilio/status/1'
}
  })
  .then((notification) => {
        console.log('Notify: ', notification.sid);
function generateUsername(username){
let u = Meteor.users.findOne({ username });
let n=0;
let uname=username;
while(u){
n++;
uname = username+n;
u = Meteor.users.findOne({ username:uname });
}
return uname;
@m-pokrovskii
m-pokrovskii / sample.json
Created June 1, 2016 04:49
odoo sample products
{
"_id" : "6YvWEPbxzcNzjKEag",
"incoming_qty" : 0,
"standard_price" : 12.41,
"write_uid" : [
5,
"Malik"
],
"display_name" : "ZYRTEC DROPS 10ML",
"item_ids" : [ ],
product: {
id: 1,
title: "ProductTitle",
supplierID: 1,
_last_change: "29.29.16"
}
supplier: {
id: 1,
title: "SupplierTItle",
@m-pokrovskii
m-pokrovskii / gist:7717995
Created November 30, 2013 11:38
text-shadow inner shadow trick
.counter-corner__counter {
position: relative;
color: #000;
font-weight: bold;
}
.counter-corner__counter:before {
content: attr(title);
color: transparent;
position: absolute;
.ps-container .ps-scrollbar-y {
position: absolute; /* please don't change 'position' */
right: 14px; /* there must be 'right' for ps-scrollbar-y */
width: 8px;
background-color: #00aeef;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
opacity: 0;
filter: alpha(opacity = 0);
@m-pokrovskii
m-pokrovskii / css.css
Created September 14, 2013 04:26
Add a Link Around an Embedded Flash File
.flash-wrap{
position: relative;
}
.flash-link{
position: absolute; top:0px; left:0px;
width:180px; /*Flash Size*/
height:220px;
/*background: url('images/0.gif') no-repeat;*/ /*You should uncommented this line for support old IE version.*/
}
@m-pokrovskii
m-pokrovskii / index.php
Created September 6, 2013 17:00
Wordpress.Redirect all pages to home for non-authorized users
if (!current_user_can('edit_others_posts')) {
$redirect_to = get_option('home');
wp_redirect($redirect_to,302);
}
@m-pokrovskii
m-pokrovskii / admin.js
Created September 3, 2013 00:14
Wordpress. Change date by bulk edit action
(function($){
$('#bulk-edit .inline-edit-col-right .inline-edit-col')
.append(
'<label><span class="title">Date</span></label>'
+'<div class="inline-edit-date">'
+'<div class="timestamp-wrap"><select name="mm">'
+'<option value="00">Select</option>'
+'<option value="01">01-Jan</option>'
+'<option value="02">02-Feb</option>'
+'<option value="03">03-Mar</option>'
@m-pokrovskii
m-pokrovskii / gist:6251224
Created August 16, 2013 16:09
alias for runing google chrome on mac with attribute "--allow-file-access-from-files"
alias chrome-local='open /Applications/Google\ Chrome.app --args --allow-file-access-from-files'