Skip to content

Instantly share code, notes, and snippets.

View fael's full-sized avatar

Rafael Santos Sá fael

  • OLX
  • Lisbon, Portugal
View GitHub Profile
@rdmurphy
rdmurphy / dabr.js
Created November 3, 2011 19:21
"Do a Barrel Roll!" Bookmarklet
javascript:(function(){var%20css=document.createElement("style");css.type="text/css";css.innerHTML="@-moz-keyframes%20roll%20{%20100%25%20{%20-moz-transform:%20rotate(360deg);%20}%20}%20@-o-keyframes%20roll%20{%20100%25%20{%20-o-transform:%20rotate(360deg);%20}%20}%20@-webkit-keyframes%20roll%20{%20100%25%20{%20-webkit-transform:%20rotate(360deg);%20}%20}%20body{%20-moz-animation-name:%20roll;%20-moz-animation-duration:%204s;%20-moz-animation-iteration-count:%201;%20-o-animation-name:%20roll;%20-o-animation-duration:%204s;%20-o-animation-iteration-count:%201;%20-webkit-animation-name:%20roll;%20-webkit-animation-duration:%204s;%20-webkit-animation-iteration-count:%201;%20}";document.getElementsByTagName('head')[0].appendChild(css)})();
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@Yavari
Yavari / README.markdown
Created February 23, 2012 09:00 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@abdalla
abdalla / CustomControllerFactory.cs
Created March 5, 2012 22:38
RavenDB Repository
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Msdev.EventSystem.Core.Data.Raven;
using Raven.Client.Document;
namespace Msdev.EventSystem.Ui.Controllers.Factory
{
@abdalla
abdalla / gist:1986624
Created March 6, 2012 14:42
Using AutoMApper
>Basic
Mapper.CreateMap<EventViewModel, Event>();
Event _event = Mapper.Map<EventViewModel, Event>(model);
>Ignoring Some Fields
Mapper.CreateMap<EventViewModel, Event>().ForMember("EventId", r => r.Ignore()).ForMember("CreatedOn", r => r.Ignore()).ForMember("EventStatusId", r => r.Ignore());
_event = Mapper.Map(model, _event);
@luetkemj
luetkemj / wp-query-ref.php
Last active September 14, 2024 13:06
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
<html xmlns:fb="http://ogp.me/ns/fb#">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# oghowto: http://ogp.me/ns/fb/oghowto#">
<title>OG Tutorial App</title>
<meta property="fb:app_id" content="256521937796214" />
<meta property="og:type" content="oghowto:demo" />
<meta property="og:title" content="Open Graph HowTo" />
<meta property="og:image" content="http://placehold.it/200x200" />
<meta property="og:description" content="Minimum requirements to get Open Graph objects and actions working" />
<meta property="og:url" content="http://oghowto.herokuapp.com/test.html">
<style type="text/css">
@sgmurphy
sgmurphy / url_slug.js
Created July 12, 2012 02:05
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <[email protected]>
@umidjons
umidjons / pdf-thumbnail-php.md
Last active December 6, 2023 21:41
Creating PDF thumbnails in PHP

Creating PDF thumbnails in PHP

Install Ghostscript

Download and install right version of ghostscript. In my case my PHP was x86 architecture, so I download Ghostscript 9.14 for Windows (32 bit).

Enable ImageMagick

@astockwell
astockwell / README.md
Last active June 14, 2024 13:17
PHP Video Url Parser

Youtube/Vimeo Video Url Parser

Parses URLs from major cloud video providers. Capable of extracting keys from various video embed and link urls to manipulate and access videos in various ways.

Usage

VideoUrlParser::identify_service("https://www.youtube.com/watch?v=x_8kFbZf20I&amp;feature=youtu.be");