Skip to content

Instantly share code, notes, and snippets.

View eugenepyvovarov's full-sized avatar
:octocat:

Eugene Pyvovarov eugenepyvovarov

:octocat:
View GitHub Profile
@eugenepyvovarov
eugenepyvovarov / gist:8038736
Created December 19, 2013 12:59
Only show admin bar to administrators
<?php
// Snippet code goes here!
if (!current_user_can('administrator')) :
show_admin_bar(false);
endif;
?>
{
'Charges':[
{
'ChargeData':{
'PrimaryInsuranceInsuranceAllowed':None,
'ServiceStartDate':u'05/26/2014',
'TotalCharges':u'0.0000',
'BatchNumber':None,
'TertiaryInsuranceCompanyPlanName':u'Medicare CA',
'OtherPaymentAmount':None,
----------
Publishing prod using rsync from /srv/eloquens/dev/catalog/ ...
** Giving ownership & rights to bsn while synchronizing...
[DRY RUN] Nothing done
** Synchronizing dev toward prod...
sending incremental file list
.htaccess
LICENSE
@eugenepyvovarov
eugenepyvovarov / gist:e5537e56cd76ccc0da1f
Last active November 11, 2015 13:34
SPHERO create media with external media file as source for media
curl https://wl.dev.cwist.com/api/v1/login/ -d "[email protected]&password=cvrt" -k
# response {"token":"8ae254cca97772f4269ac5af93ad55b67284de41"}
curl -X POST -H "Content-Type:multipart/form-data" -H "Authorization: Token 8ae254cca97772f4269ac5af93ad55b67284de41" -F "ext_media_url=http://zacronym.com/wp-content/uploads/2014/04/Mickey-Mouse51.jpg" -F "description=Test desciprtion for media" -F "title=Mickey Mouse" https://wl.dev.cwist.com/api/v1/remixes/ -k
# result
{"id":1984,"preview_url":"https://wl-media-dev.s3.amazonaws.com/cwist/gallery/bb/43/838f60d0bb4349dea1f68197b4328b3b_250_250.jpg","big_preview_url":"https://wl-media-dev.s3.amazonaws.com/cwist/gallery/bb/43/838f60d0bb4349dea1f68197b4328b3b_500_500.jpg","media_is_video":false,"media_is_image":true,"is_program":false,"kid_or_parent":"Cvrt the #1","rel_cwist":null,"rel_cwist_name":null,"rel_cwist_id":null,"rating_dict":{},"rating":"0","url":"https://wl.dev.cwist.com/api/v1/remixes/1984/","status":"private","robots":[],"parent_image_url":"
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
-- Set selected Address Book contact pictures from Gravatar.
-- Released under GPL.
-- by Doug Smith, http://smithsrus.com
-- Fixed md5_email routine by Tatsuhiko Miyagawa
-- Grab the selected records and see how many there are.
tell application "Address Book"
set selected_contacts to selection
set count_selected to number of items in selected_contacts