Skip to content

Instantly share code, notes, and snippets.

View Ambient-Impact's full-sized avatar

Matei Stanca Ambient-Impact

View GitHub Profile
@chrisl8888
chrisl8888 / drush.txt
Created August 22, 2012 20:07
fun advanced drush commands
# have drush rsync a particular file folder
drush rsync @dev:%files @local:%files --progress
# have sql-sync get the database from the server without cache
drush sql-sync @dev @local --no-cache
# have drush perform a git-pull
drush @site.dev gp
@juampynr
juampynr / mymodule.info
Last active June 9, 2023 21:53
Drupal 7 Views 3 custom field handler
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
@halcarleton
halcarleton / SublimeText-Project-Line-Count
Last active August 6, 2023 16:09 — forked from Hexodus/count_total_project_code_lines_in_sublime
Count total lines of code in a Sublime Text Project or Directory
Go to menu:
Find -> Find in Files... (windows: ctrl+shift+f)
Switch on reg_ex button (windows: alt+r)
Find:
^.*\S+.*$
Where:
c:\your_folder\,*.php,*.js,*.inc,*.html,*.htm,*.scss, -*/folder_to_exclude/*, -*.min.js
@JohnAlbin
JohnAlbin / SassMeister-input.scss
Created May 28, 2014 01:08
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
.component,
%component {
content: 'component';
&--variant {
@RadGH
RadGH / phone-number.php
Last active May 31, 2023 08:00
Convert user-inputted phone number to consistently formatted HTML link, with extension support
<?php
// improved version: https://gist.github.com/RadGH/31f16cd4705a2d8076021a9ad528f34f
// ----------
// Example #1: HTML
$phone_number = '555.123.4567';
echo format_phone( $phone_number );
@WebReflection
WebReflection / html-escape.md
Last active August 21, 2022 16:27
How to escape and unescape from a language to another

update

I've created a little repository that simply exposes the final utility as npm module.

It's called html-escaper


there is basically one rule only: do not ever replace one char after another if you are transforming a string into another.

@finteractive
finteractive / sass-to-svg.md
Last active August 29, 2015 14:14
SVG's & SASS - SASS-TO Meetup January 2015

SASS-TO SVG & SASS - January 2015

Introductions

  • What's your focus / work?
  • What was the last thing you found challenging/frustrating in SASS

#SVG with SASS and Gulp#

Let's start downloading stuff during intro...

@paulirish
paulirish / what-forces-layout.md
Last active July 4, 2025 06:51
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
@pfaocle
pfaocle / gen-d8-salt.sh
Created March 8, 2016 09:39
Generate Drupal 8 hash salt
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))"
@adactio
adactio / formProgress.js
Created May 29, 2016 15:27
Show a progress bar with every form that has a method of POST. Particularly nice if there's a file upload involved.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function (win, doc) {
'use strict';
if (!win.XMLHttpRequest || !win.FormData || !win.addEventListener || !doc.querySelectorAll) {
// doesn't cut the mustard.
return;
}
function hijaxForm (formElement) {
var progressBar;