Skip to content

Instantly share code, notes, and snippets.

View cristianstan's full-sized avatar
🎯
Focusing

Cristian Stan cristianstan

🎯
Focusing
View GitHub Profile
@j0lvera
j0lvera / wpinstall
Created December 20, 2013 06:22
Install WordPRess
#!/bin/bash -e
# Install WordPress and clean the folder
echo "======================"
echo " Installing WordPress "
echo "======================"
echo ""
# Download the files (cURL works fine here too)
wget http://wordpress.org/latest.tar.gz
@helen
helen / repeatable-fields-metabox.php
Created January 11, 2012 04:42
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@JeffreyWay
JeffreyWay / jquery-method.js
Created January 3, 2012 20:01
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>';
});
@chrisguitarguy
chrisguitarguy / comments-example.php
Created September 21, 2011 21:44
How to add custom fields to WordPress comments
<?php
/*
Plugin Name: Add Extra Comment Fields
Plugin URI: http://pmg.co/category/wordpress
Description: An example of how to add, save and edit extra comment fields in WordPress
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: MIT
*/
<?php
class envato_marketplace {
public static $base_url = 'http://marketplace.envato.com/api/edge/';
public function curl($path) {
$ch = curl_init(self::$base_url . $path);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);