Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
CodeMyUI / gradient-button-hover.markdown
Created September 20, 2018 00:33
Gradient Button Hover
@paulirish
paulirish / what-forces-layout.md
Last active March 15, 2026 16:37
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@tomazzaman
tomazzaman / hhvm.conf
Last active May 13, 2021 19:44
Monit configurations for commonly used services
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@elliotbonneville
elliotbonneville / topkeywords.js
Last active April 5, 2025 00:41
Find top keywords associated with a Google search with this Node.js 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
/**
* 1. create project at https://console.developers.google.com/project
* 2. enable 'Analytics API' under 'APIs & auth' / APIs
* 3. create 'NEW CLIENT ID' (OAuth client) under 'APIs & auth' / Credentials
* i. select 'Service account'
* ii. save generated key file to 'key.p12'
* iii. remember CLIENT ID
* 4. under GA account add 'Read & Analyze' access to newly generated email (access to GA Account not Property nor View)

Running Magento Enterprise Edition with Facebook HipHop HHVM

Prerequisites

Hardware

MacBook Air (MBA) Mid 2012

@robinnorth
robinnorth / wordpress_export-post-data.php
Created April 26, 2013 11:44
WordPress: Simple, configurable script to export post data to a CSV file
<?php
/**
* Export WordPress post data to CSV
* Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/>
*/
/**
*********************************************************************
* Configuration
*********************************************************************
@dcrystalj
dcrystalj / zip slovenia
Created April 14, 2013 13:09
zip slovenia
['zip'=>'1000', 'name'=> 'Ljubljana']
['zip'=>'1001', 'name'=> 'Ljubljana - P.P.']
['zip'=>'1210', 'name'=> 'Ljubljana - Šentvid']
['zip'=>'1211', 'name'=> 'Ljubljana - Šmartno']
['zip'=>'1215', 'name'=> 'Medvode']
['zip'=>'1216', 'name'=> 'Smlednik']
['zip'=>'1217', 'name'=> 'Vodice']
['zip'=>'1218', 'name'=> 'Komenda']
['zip'=>'1219', 'name'=> 'Laze v Tuhinju']
['zip'=>'1221', 'name'=> 'Motnik']
@arosenhagen
arosenhagen / magento-code-snippets.md
Last active March 22, 2025 08:49
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@faisalman
faisalman / XML2003Parser.php
Created March 9, 2011 19:00
PHP class for parsing Microsoft Excel 2003 XML Spreadsheet
<?php
/**
* Excel 2003 XML-Parser
*
* PHP library for parsing Microsoft Excel 2003 XML Spreadsheet
* http://gist.github.com/862741
*
* Copyright (c) 2011 Faisalman <movedpixel@gmail.com>
*