Skip to content

Instantly share code, notes, and snippets.

@gradosevic
gradosevic / wordpress-plugin-svn-to-git.md
Created November 13, 2015 09:08 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
@gradosevic
gradosevic / React-DropDown.js
Created February 17, 2016 10:17
React DropDown component
/**
* React dropdown component
* Usage: <DropDown selected={selectedValue} items={keyValueObject} onChange={this.externalDropdownOnChangeMethod} />
*
* //For example:
* var keyValueObject = {0 =>'Value 0', 1 => 'Value 1'};
*
* //External on dropdown change method
* externalDropdownOnChangeMethod(e){
* var value = e.target.value;
@gradosevic
gradosevic / app.jsx
Created April 28, 2016 06:56 — forked from insin/app.jsx
React Form Handling - handleFormInputChange (Live version: http://bl.ocks.org/insin/raw/082c0d88f6290a0ea4c7/)
var INPUT_TYPES = 'color|date|datetime|datetime-local|file|month|number|password|range|search|tel|text|time|url|week'.split('|')
var App = React.createClass({
getInitialState: function() {
return {}
},
onChange: handleFormInputChange,
render: function() {
@gradosevic
gradosevic / JVZoo.php
Created August 23, 2016 09:26 — forked from ashitvora-zz/JVZoo.php
Verify JVZoo Request
<?php namespace Alfanso\Services\Jvzoo;
class Jvzoo {
public function isValidRequest($data) {
$jvzooSecretKey = config('jvzoo.secret_key');
$receivedVerificationCode = $data['cverify'];
// remove cverify from the array since we don't use that
unset($data['cverify']);
@gradosevic
gradosevic / 00.howto_install_phantomjs.md
Created December 4, 2016 14:38 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@gradosevic
gradosevic / htpasswd
Created December 10, 2016 18:29 — forked from neotohin-snippet/htpasswd
htpasswd
**INLCUDE htpasswd**
To generate .htpasswd:
htpasswd -c ./.htpasswd admin
Add this in .htaccess:
AuthUserFile /home/test/public_html/.htpasswd
AuthGroupFile /dev/null
@gradosevic
gradosevic / wordpress_add_custom_post_type_column.php
Last active February 27, 2017 16:43
WordPress: custom post type column, create, link and sort by
<?php
function manage_mypostype_custom_column( $column, $post_id ) {
global $post;
switch( $column ) {
case 'category':
$terms = get_the_terms( $post_id, 'mypostype-category' );
if($terms[0]){
$theCategory = $terms[0]->name;
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/bin/npm', 'i', '-g', 'npm@latest' ]
2 info using npm@3.10.10
3 info using node@v8.4.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData npm@latest
8 silly fetchNamedPackageData npm
9 silly mapToRegistry name npm
@gradosevic
gradosevic / github_markup_code_highlighting
Created March 9, 2016 12:20
Highlight code in GitHub Markup. Example ```Cucumber
Cucumber ('*.feature')
abap ('*.abap')
ada ('*.adb', '*.ads', '*.ada')
ahk ('*.ahk', '*.ahkl')
apacheconf ('.htaccess', 'apache.conf', 'apache2.conf')
applescript ('*.applescript')
as ('*.as')
as3 ('*.as')
asy ('*.asy')
bash ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass')