This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# avoid pre-commit hooks when fixing conflicts/merging | |
git rev-parse -q --verify MERGE_HEAD && exit 0 | |
# list all staged JS and TS files | |
js_ts_files=$(git diff --diff-filter=d --name-only --cached | grep -E '\.(js|jsx|ts|tsx)$') | |
############# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// open a collection in Yandex Translate and run the following script in your browser's developer console | |
function parseCollection() { | |
const arr = []; | |
document.querySelectorAll('.record-item_text > div:nth-child(2)').forEach(el => { | |
arr.push([el.textContent]) | |
}) | |
document.querySelectorAll('.record-item_translation > div:nth-child(2)').forEach((el, index) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
"@serverless-stack/resources": "0.59.1" | |
*/ | |
const deadLetterQueue = new sst.Queue(this, "DeadLetterQueue", { | |
sqsQueue: { | |
visibilityTimeout: Duration.hours(12), | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
cob = checkout -b | |
b = branch | |
bb = branch -vvv | |
ll = log --oneline | |
l = log | |
brd = branch -d | |
brD = branch -D | |
reom = !git fetch && git rebase origin/master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const browserSync = require('browser-sync'); | |
gulp.task('mobile', function() { | |
browserSync({ | |
proxy: 'localhost:8080', | |
open: false, | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// don't forget to install node-sass, sass-loader and (save-dev) css-hot-loader | |
'use strict'; | |
const autoprefixer = require('autoprefixer'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); | |
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var path = require('path'); | |
const webpack = require('webpack'); | |
const NODE_ENV = process.env.NODE_ENV || 'development'; | |
//const NODE_ENV = 'production'; | |
module.exports = { | |
context: __dirname + "/frontend", | |
entry: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fix bug when custom posts archive pagination does not work on page 2 and subsequent. | |
// This is the hack which works when WP_Query (not default loop) is used | |
$option_posts_per_page = get_option( 'posts_per_page' ); | |
add_action( 'init', 'my_modify_posts_per_page', 0); | |
function my_modify_posts_per_page() { | |
add_filter( 'option_posts_per_page', 'my_option_posts_per_page' ); | |
} | |
function my_option_posts_per_page( $value ) { | |
global $option_posts_per_page; | |
if ( is_tax( 'skill_tag') ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Example Contact Form | |
Plugin URI: http://example.com | |
Description: Simple non-bloated WordPress Contact Form | |
Version: 1.0 | |
Author: Agbonghama Collins | |
Author URI: http://w3guy.com | |
Text Domain: cform | |
*/ |
NewerOlder