Skip to content

Instantly share code, notes, and snippets.

wesruv wesruv

Block or report user

Report or block wesruv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
paceaux / queryCSSProperty
Last active Jun 30, 2019
Get all CSS selectors containing a particular CSS property
View queryCSSProperty
/** queryCSSByPropertyName
* queries the CSSOM looking for CSS rulesets containing a particular CSS property.
* @param {string} queryPropName CSS property name
* @param {string} queryPropValue value of CSS property
* @returns Map with key as CSS selector, value as CSS properties.
function queryCSSByProperty(queryPropName, queryPropValue) {
const styleSheets= document.styleSheets; // get all the stylesheets
const properties = new Map(); // set up the variable that'll store our result
jeromecoupe / webstoemp-gulpfile.js
Last active Jan 17, 2020
Gulp 4 sample gulpfile.js. For a full explanation, have a look at
View webstoemp-gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
ipbastola /
Last active Jan 15, 2020
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64


Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
wangruohui / Install NVIDIA Driver and
Last active Jan 12, 2020
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
View Install NVIDIA Driver and
cbednarski /
Last active Sep 16, 2019
Host a factorio server
eugene-ilyin / render_menu.php
Last active Oct 26, 2017
Render menu programmatically in Drupal 7
View render_menu.php
// One level menu.
$menu = menu_tree('main-menu');
$menu_items = render($menu);
// Menu with many levels.
$menu = menu_build_tree('main-menu');
$menu_items = render(menu_tree_output($menu));
jibran / .eslintrc
Last active Jul 19, 2017
Sample eslint file for Drupal 7
View .eslintrc
"env": {
"browser": true
"globals": {
"Drupal": true,
"jQuery": true,
"tinyMCE": true
"rules": {
jdillick / generate-strongarms.php
Last active Aug 29, 2015
Drush script to generate strongarm variables module for a site
View generate-strongarms.php
$args = drush_get_arguments();
if ( ! isset($args[2]) ) {
drush_set_error('Usage: drush @<alias> scr generate-strongarm.php <module_name> <base_path>');
$module_name = $args[2];
if ( ! isset($args[3]) ) {
jdillick / aliases.drushrc.php
Last active Dec 24, 2015
Dynamic drush aliases. Just modify $paths to include the directory to your drupal installs, and you have instant aliases.
View aliases.drushrc.php
// the current environment
$env = $_ENV['ENVTYPE'] ? $_ENV['ENVTYPE'] : '';
// paths to search for drupal sites
$paths = array(
naxoc / pre-commit
Created Nov 26, 2012
Drupal git commit hook
View pre-commit
* @file
* This is a Git pre-commit hook that informs you when you are
* about to commit whitespace or a debug function.
$red = "\033[1;31m";
$red_end = "\033[0m";
You can’t perform that action at this time.