Skip to content

Instantly share code, notes, and snippets.

View mbejda's full-sized avatar
🎯
Focusing

Milos Bejda mbejda

🎯
Focusing
View GitHub Profile
@mbejda
mbejda / gist:7375622
Created November 8, 2013 18:46
Ember.js : List-to
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery-2.0.2.js"></script>
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery-2.0.2.js"></script>
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
</head>
<body>
<% layout('../../../layout/dashboard.ejs') %>
<div data-bind="page: {id:'campaigns', role:'start',fx: 'slide', sourceOnShow: '/html/influencer/pages/campaigns/campaigns.html',beforeShow:Pages.viewCampaigns}"></div>
<div data-bind="page: {id:'campaign',scrollToTop:true}">
<div data-bind="page: {id:'view', fx: 'slide', sourceOnShow: '/html/influencer/pages/campaigns/campaign.html',beforeShow:Pages.viewCampaign, scrollToTop: true, sourceCache: true}"></div>
</div>
<div data-bind="page: {id:'account', fx: 'slide', sourceOnShow: '/html/influencer/pages/account/account.html',beforeShow:Pages.viewAccount}"></div>
<div data-bind="page: {id:'funds', fx: 'slide', sourceOnShow: '/html/advertiser/pages/funds/funds.html',beforeShow:Pages.viewFunds}"></div>
@mbejda
mbejda / add_role
Last active December 28, 2015 02:49
<?php add_role( $role, $display_name, $capabilities ); ?>
<?php
$result = add_role('basic_contributor', 'Basic Contributor', array(
'read' => true, // True allows that capability
'edit_posts' => true,
'delete_posts' => false, // Use false to explicitly deny
));
if (null !== $result) {
echo 'Yay! New role created!';
{
"code": "",
"data": {
"count": 60,
"records": [{
"liked": 0,
"foursquareVenueId": null,
"userId": "958614911402057728",
"private": 0,
"likes": {
ko.bindingHandlers.datepicker = {
init: function(element, valueAccessor, allBindingsAccessor) {
//initialize datepicker with some optional options
var options = allBindingsAccessor().datepickerOptions || {};
$(element).datepicker(options);
//when a user changes the date, update the view model
ko.utils.registerEventHandler(element, "changeDate", function(event) {
var value = valueAccessor();
if (ko.isObservable(value)) {
<?php
/**
* Cart Page
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
global $woocommerce;
for(var y = 0; y < 20; y++)
{
console.log("Y "+y);
var temp = 0;
for(var x = 0; x < y; x++)
{
console.log("X "+x);
temp = temp + x;
}
@mbejda
mbejda / gist:8671545
Created January 28, 2014 16:51
API Sample
var call = {
object: 'accounts',
method: 'get',
action: 'allInfluencers'
}
var accountObject = function () {
var self = this;
self.allInfluencers = function () {
console.log('YES')
}
@mbejda
mbejda / gist:8955865
Created February 12, 2014 13:48
Create WordPress Shell script using WP CLI
echo "Please enter some dbname: "
read dbname
mkdir $dbname
cd $dbname
wp core download
wp core config --dbname=$dbname --dbuser=root --dbhost=localhost
wp db create $dbname
wp core install --url="http://localhost" --title="Your Blog Title" --admin_user="admin" --admin_password="password" --admin_email="admin@admin.com"