Skip to content

Instantly share code, notes, and snippets.

View sagar290's full-sized avatar
🏠
Working from home

Sagar sagar290

🏠
Working from home
View GitHub Profile
@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() {
@joseph-montanez
joseph-montanez / README.md
Created March 4, 2012 01:37
JSON-RPC server in PHP

== JSON-RPC ==

This is designed to have to autoload calls and return a json object. It supports PHP 5.3's namespaces, and relies on PHP's built in Reflection.

Example: htttp://localhost/rpc.php?0={"method":"foo\myclass::hello","params":[], "id":2}

Returns: {"result":"Hello World","error":null,"id":2}

@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@edwardhotchkiss
edwardhotchkiss / angular_app.js
Created May 25, 2012 03:22
Jekyll Live Search with AngularJS (blog)
/**
* Setup Module with `highlight` filter
*/
var JekyllApp = angular.module('JekyllApp', [], function($routeProvider) {
});
JekyllApp.filter('highlight', function() {
return function(text, filter) {
@PhirePhly
PhirePhly / Makefile
Created June 12, 2012 03:12
A crazy simple SMTP server, for educational purposes only.
default:
cc ccsmtp.c -o ccsmtpd -lpthread
@rxaviers
rxaviers / gist:7360908
Last active May 25, 2024 01:57
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@aamnah
aamnah / lamp.sh
Last active February 19, 2024 11:51
Bash script to install Apache, MySQL and PHP as well as PHPMyAdmin and some tweaks. For Debian and Ubuntu. To run, copy the script to the server and run ``bash lamp.sh``
#!/bin/sh
#######################################
# Bash script to install an AMP stack and PHPMyAdmin plus tweaks. For Debian based systems.
# Written by @AamnahAkram from http://aamnah.com
# In case of any errors (e.g. MySQL) just re-run the script. Nothing will be re-installed except for the packages with errors.
#######################################
#COLORS
@cliffordp
cliffordp / functions.php
Last active September 23, 2023 06:22
Automatically login a single WordPress user upon arrival to a specific page.
<?php
/**
* Automatically login a single WordPress user upon arrival to a specific page.
*
* Redirect to home page once logged in and prevent viewing of the login page.
* Compatible with WordPress 3.9.1+
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1.
*
@roachhd
roachhd / README.md
Last active May 23, 2024 22:38
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

@hlashbrooke
hlashbrooke / function.php
Last active May 30, 2020 15:39
WordPress: Check if user role exists
function role_exists( $role ) {
if( ! empty( $role ) ) {
return $GLOBALS['wp_roles']->is_role( $role );
}
return false;
}