Skip to content

Instantly share code, notes, and snippets.

View rafasashi's full-sized avatar
👍
Happy

Raphaël Dartigues rafasashi

👍
Happy
View GitHub Profile

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">
<?php
$link=mysql_pconnect($db['write']['host'],$db['write']['user'],$db['write']['pass']) or die ("Could not connect to datadase");
mysql_select_db($db['write']['name']) or die ("could not select database");
//patharray is an essentially an exploded $_SERVER['REQUEST_URI']
//for articles rss feeds it would be /rss/articles/categoryname
//so $patharray[0]='rss', $patharray[1]='articles' and $patharray[2]='categoryname'
const('SITENAME','Example.com');
const('WEBMASTER','[email protected] ([email protected])');

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@rafasashi
rafasashi / parser.php
Last active August 29, 2015 14:21 — forked from martinsik/parser.php
<?php
$curl = curl_init('http://www.livescore.com/soccer/england/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10');
$html = curl_exec($curl);
curl_close($curl);
if (!$html) {

Gearman can be installed on Windows through cygwin.

Install Cygwin packages

Install cygwin packages (through setup.exe):

  • gcc
  • make
  • libuuid1-devel
  • libiconv
@rafasashi
rafasashi / README.rst
Last active August 29, 2015 14:22 — forked from dupuy/README.rst

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

<?php
if (!isset($_SESSION['user'])) {
require_once( COMPONENTS . "/user/class.user.php" );
$_SESSION['user'] = $_SERVER['PHP_AUTH_USER'];
$_SESSION['lang'] = 'en';
$_SESSION['theme'] = 'default';
$_SESSION['project'] = '/var/www';
$User = new User();
@rafasashi
rafasashi / Migrate SPIP 2 to Wordpress with SQL.md
Last active September 29, 2015 14:35 — forked from angezanetti/FromSPIPtoWordpress.sql
Migrate SPIP 2 and 3 to Wordpress with MySQL

##Imports terms

REPLACE INTO wp_terms(term_id, name, slug, term_group)
SELECT    id_rubrique, titre, CONCAT("rub",id_rubrique), 1 FROM spip_rubriques;

Update urls

UPDATE wp_terms, spip_urls
SET slug = spip_urls.url

WHERE spip_urls.id_objet = term_id

@rafasashi
rafasashi / bootbox-dialog-v4-all.js
Created November 3, 2015 18:25 — forked from makeusabrew/bootbox-dialog-v4-all.js
An attempt to demonstrate as many bootbox.dialog options as sanely possible in a single-file gist.
bootbox.dialog({
/**
* @required String|Element
*/
message: "I am a custom dialog",
/**
* @optional String|Element
* adds a header to the dialog and places this text in an h4
*/
@rafasashi
rafasashi / Readme.md
Created June 14, 2016 23:24 — forked from atomotic/Readme.md
Internet Archive Save Page Now