Skip to content

Instantly share code, notes, and snippets.

Avatar

wesruv wesruv

View GitHub Profile
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active Nov 30, 2020
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
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");
View semantic-commit-messages.md

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active Nov 28, 2020
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

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

Reference

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

1. Check the current kernel version

$ uname -r 
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active Nov 26, 2020
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
View Install NVIDIA Driver and CUDA.md
@181192
181192 / increase_root_fedora.md
Created Nov 5, 2018
How to increase the root partition size on Fedora
View increase_root_fedora.md

How to increase the root partition size on Fedora

Boot up with an Fedora Live USB stick.

  1. Run vgs to check if there's any space:
$ sudo vgs
  VG     #PV #LV #SN Attr   VSize    VFree
  fedora   1   3   0 wz--n- <237.28g    0 
@paceaux
paceaux / queryCSSProperty
Last active Oct 19, 2020
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
@cbednarski
cbednarski / factorio.md
Last active Aug 9, 2020
Host a factorio server
View factorio.md
@JustAdam
JustAdam / drupal_taxonomy_content_type.php
Created Aug 2, 2012
Drupal 7 - Programmatically create a taxonomy and attach a field to it, then create a content type and attach that taxonomy to it.
View drupal_taxonomy_content_type.php
<?php
// Machine name for our custom node
define('NODE_NAME', 'the_node_machine_name');
// Machine name for our custom taxonomy
define('TAXONOMY_NAME', 'the_taxonomy_machine_name');
function module_install() {
_create_taxonomy();
_create_content_type();
}
@eugene-ilyin
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_tree_all_data('main-menu');
$menu = menu_build_tree('main-menu');
$menu_items = render(menu_tree_output($menu));
@jibran
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": {
You can’t perform that action at this time.