Skip to content

Instantly share code, notes, and snippets.

View mrkpatchaa's full-sized avatar

Médédé Raymond KPATCHAA mrkpatchaa

View GitHub Profile

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@mrkpatchaa
mrkpatchaa / dabblet.css
Created June 14, 2014 20:27 — forked from LeaVerou/dabblet.css
(C)Leanest CSS spinner ever
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;
@mrkpatchaa
mrkpatchaa / 0_reuse_code.js
Created July 25, 2014 21:23
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
@mrkpatchaa
mrkpatchaa / get_ip_address_php
Created September 28, 2014 11:23
Get user ip address in php
<?PHP
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
@mrkpatchaa
mrkpatchaa / Social Network Share Count
Created October 6, 2014 08:02
Getting Social Network Share Count from Facebook, Twitter, Pinterest, Linkedin, Google Plus, StumbleUpon
// Facebook Likes and Shares
$facebook_like_share_count = function ( $url ) {
$api = file_get_contents( 'http://graph.facebook.com/?id=' . $url );
$count = json_decode( $api );
return $count->shares;
};
@mrkpatchaa
mrkpatchaa / slip_scrol_effect.css
Created October 25, 2014 21:41
How to Give Your Logo the “Slip Scroll” Effect
.container {
overflow: hidden;
position: relative;
min-height: 400px;
padding: 1em;
}
.dark {
background: #333;
}
//
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
//
// You may use it in your theme if you credit me.
// It is also free to use on any individual website.
//
// Exception:
// The only restriction would be not to publish any
// extension for browsers or native application
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@mrkpatchaa
mrkpatchaa / dequeue-styles-and-scripts.php
Created February 29, 2016 05:53
Dequeue Styles and Scripts In WordPress
<?php
/** From http://www.paulund.co.uk/dequeue-styles-scripts-wordpress */
/**
* Dequeue JavaScript or Stylesheet.
*/
function dequeue_script()
{
// Run the dequeue script with the handle of the JavaScript file
wp_dequeue_script( $handle );