Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

dankkomcg dankkomcg

🎯
Focusing
Block or report user

Report or block dankkomcg

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
@dankkomcg
dankkomcg / fix-homebrew-npm.md
Last active Aug 22, 2019 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew
View fix-homebrew-npm.md

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@dankkomcg
dankkomcg / webpack.config.js
Created Apr 3, 2019
Default config webpack for JS sites
View webpack.config.js
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); //installed via npm
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpack = require('webpack'); //to access built-in plugins
module.exports = {
entry: {
index: './src/js/index.js',
shards: './src/js/shards.js'
},
View secu.yml
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_SUPER_ADMIN: ROLE_ADMIN
ROLE_ADMIN: [ROLE_USER, ROLE_TOURNAMENT_MANAGER, ROLE_EDITOR]
ROLE_TOURNAMENT_MANAGER: [ROLE_USER, ROLE_EDITOR]
ROLE_EDITOR: ROLE_USER
@dankkomcg
dankkomcg / php72
Created Mar 5, 2019
Install php7.2 on UBuntu based distros
View php72
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install -y php7.2
sudo apt install php7.2-curl php7.2-gd php7.2-json php7.2-mbstring
# fix mcrypt for php72
sudo apt-get install php7.2-dev # to run phpize
@dankkomcg
dankkomcg / wp_rewrite.php
Created Dec 14, 2018
Rewrite from script instead of WP-Admin
View wp_rewrite.php
<?php
add_action( 'init', function() {
global $wp_rewrite;
$wp_rewrite->set_permalink_structure(
// you have to know the permalink rules on WordPress
'/%year%/%monthnum%/%postname%/'
);
} );
@dankkomcg
dankkomcg / add-term-to-custom-taxonomy.php
Created Nov 21, 2018 — forked from ms-studio/add-term-to-custom-taxonomy.php
add term metabox to custom taxonomy - using WP 4.4 term meta functions
View add-term-to-custom-taxonomy.php
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
// CREATE CUSTOM TAXONOMY
add_action( 'init', '___create_my_custom_tax' );
@dankkomcg
dankkomcg / hide-editor.php
Created Nov 21, 2018 — forked from ramseyp/hide-editor.php
Hide the content editor for certain pages in WordPress
View hide-editor.php
<?php
/**
* Hide editor on specific pages.
*
*/
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
// Get the Post ID.
View wp-dash-hacks.php
// force one-column dashboard
add_filter('screen_layout_columns', function ($columns) {
$columns['dashboard'] = 1;
return $columns;
});
add_filter('get_user_option_screen_layout_dashboard', function () {
return 1;
});
@dankkomcg
dankkomcg / cert-bot.sh
Created Nov 16, 2018
Install cert-bot letsencrypt on Ubuntu
View cert-bot.sh
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache
# Use -d to add even more domains or sub domains if you wish
sudo certbot --apache -d example.com -d www.example.com
sudo certbot renew --dry-run
@dankkomcg
dankkomcg / excel_protect_pass.bas
Created Oct 23, 2018
Protect excel with password prompt with VBA
View excel_protect_pass.bas
'Enlaces de interés:
'https://www.ozgrid.com/forum/forum/help-forums/excel-general/41608-password-prompt-vba-code-advice
'https://docs.microsoft.com/es-es/dotnet/visual-basic/language-reference/statements/if-then-else-statement
'https://stackoverflow.com/questions/3628252/closing-excel-application-using-vba
'https://analysistabs.com/excel-vba/run-macro-automatically-opening-workbook/
'https://excelforo.blogspot.com/2013/06/vba-habilitar-macros-de-excel.html
Attribute VB_Name = "OpenExcelWithPassword"
Sub Auto_Open()
You can’t perform that action at this time.