Skip to content

Instantly share code, notes, and snippets.

@wturrell
wturrell / popular-posts.php
Created March 14, 2014 12:33
Wordpress & Google Analytics - retrieve most popular posts
@edouard-lopez
edouard-lopez / gulpfile.js
Created May 5, 2014 15:18
Gulp copy font-awesome files to dist/ directory
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();
@raphaellarrinaga
raphaellarrinaga / drupal_8_php_cheat.md
Last active September 4, 2022 21:49
[Drupal 8 php/config cheatsheet] #tags: drupal8, php, config, cheatsheet

Drupal 8 PHP cheatsheet

Get current node id

$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface) {
  $nid = $node->id();
}
@michaeljymsgutierrez
michaeljymsgutierrez / color.txt
Last active November 2, 2022 20:42
Colorize Terminal
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[1;32m\]❎ DATE:\[\033[1;37m\] \d \[\033[1;32m\] ❎ USER:\[\033[1;37m\] \u \[\033[32m\] ❎ DIRECTORY:\[\033[1;37m\] \w \[\033[1;32m\] ❎ BRANCH:\[\033[1;37m\]\$(parse_git_branch)\[\033[00m\] \n\[\033[1;32m\]└ ▶ \[\033[37m\]"
GIT COLOR
#[alias]
# lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
@tommydunn
tommydunn / index.html
Last active March 12, 2024 12:58
Slick Slider with auto play YouTube, Vimeo and HTML5 video
<header>
<h1>SITE TITLE</h1>
<nav>
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">ABOUT</a></li>
<li><a href="#">SERVICES</a></li>
<li><a href="#">CONTACT</a></li>
</ul>
</nav>
@cpboyd
cpboyd / builder.dart
Created April 21, 2021 04:17
Dart/Flutter directory list build_runner
/// Configuration for using `package:build`-compatible build systems.
///
/// See:
/// * [build_runner](https://pub.dev/packages/build_runner)
///
/// This library is **not** intended to be imported by typical end-users unless
/// you are creating a custom compilation pipeline. See documentation for
/// details, and `build.yaml` for how these builders are configured by default.
import 'package:build/build.dart';