Skip to content

Instantly share code, notes, and snippets.

View cristianstan's full-sized avatar
🎯
Focusing

Cristian Stan cristianstan

🎯
Focusing
View GitHub Profile
@cristianstan
cristianstan / limit_output_chars.php
Created June 16, 2014 20:58
PHP: Limit output Chars in php
<?php
//Limiting the output of PHP's echo to 200 characters
echo substr($row['style_info'], 0, 200) .((strlen($row['style_info']) > 200) ? '...' : ''); ?>
@cristianstan
cristianstan / Remove My account sidebar links MAGENTO.php
Created June 18, 2014 13:00
Remove My account sidebar links MAGENTO
@cristianstan
cristianstan / Enable Pickup from Store module Magento
Created June 19, 2014 13:56
Enable Pickup from Store module Magento
SOURCE: http://siven76.wordpress.com/2012/05/17/magento-enable-pickup-shipping-module/
@cristianstan
cristianstan / WordPress Fonts Switcher.php
Created July 7, 2014 07:52
WordPress Fonts Switcher GET
<?php
/* ####################################################################### */
// BOF: REMOVE BEFORE SUBMIT
if (isset($_GET['font'])) {
if ($_GET['font']=='roboto') { ?>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,700,900,500' rel='stylesheet' type='text/css'>
<style>
.tp-caption.ploygon_exo_thin_100px_center,
@cristianstan
cristianstan / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cristianstan
cristianstan / BOOTSTRAP GRID
Created March 19, 2015 12:34
BOOTSTRAP GRID
background: url("http://trendwp.modeltheme.com/grid.png") repeat-y scroll 15px 0 / calc(100% - 30px) auto rgba(0, 0, 0, 0);
@cristianstan
cristianstan / class.envato2.php
Created May 12, 2016 14:38 — forked from dtbaker/class.envato2.php
Using the verify-purchase endpoint of the new Envato API to validate a purchase code.
<?php
// NOTE: verify-purchase has been deprecated and it's best to use the new /author/sale endpoint as documented on http://build.envato.com/
// created by Envato user wpdreams https://forums.envato.com/t/verify-purchase-class/3526
// usage example:
$o = EnvatoApi2::verifyPurchase( $purchase_code );
@cristianstan
cristianstan / class.envato-api-basic.php
Created May 12, 2016 14:39 — forked from dtbaker/class.envato-api-basic.php
Simple PHP class for interacting with the Envato API within a WordPress plugin
<?php
/**
* Exception handling class.
*/
class EnvatoException extends Exception {
}
@cristianstan
cristianstan / envato.lib.php
Created May 12, 2016 14:42 — forked from dtbaker/envato.lib.php
Envato PHP library by @sowailem
<?php
/**
* @file
* Integration layer to communicate with the Envato API.
*
* @see https://build.envato.com/api
*
* @outher Abdullah Sowailem.
*/
@cristianstan
cristianstan / jquery-method.js
Created May 12, 2016 14:48 — forked from JeffreyWay/jquery-method.js
Envato Marketplace API - Get Popular Items and Authors
$.getJSON('http://173.255.193.46/api/edge/popular:themeforest.json?callback=?', function(files) {
var imgs;
files = files.popular;
console.log(files); // see what's available to play with
imgs = $.map(files.items_last_week, function(file, i) {
return '<a href="' + file.url + '"><img src=' + file.thumbnail + '></a>';
});