Skip to content

Instantly share code, notes, and snippets.

View progcode's full-sized avatar
:octocat:
Csacskamacskak elonyben.

kovax progcode

:octocat:
Csacskamacskak elonyben.
View GitHub Profile
@progcode
progcode / replace_url.sql
Created April 18, 2016 08:40
WP replace url
/* Begin Here */
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_url = replace(link_url, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_image = replace(link_image, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
/*UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl' OR option_name = 'widget_text' OR option_name = 'dashboard_widget_options';*/
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@progcode
progcode / keybase.md
Created August 8, 2016 05:51
keybase.md

Keybase proof

I hereby claim:

  • I am progcode on github.
  • I am wpdaniel (https://keybase.io/wpdaniel) on keybase.
  • I have a public key whose fingerprint is EB76 7BA0 8CDA 4B38 5922 B635 9229 4546 F601 B631

To claim this, I am signing this object:

@progcode
progcode / Gruntfile.js
Created September 27, 2016 12:56
Sample Gruntfile for SASS/SCSS
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'style/style.css' : 'sass/style.scss'
}
}
},
@progcode
progcode / del.md
Last active January 16, 2017 15:58
WIN - delete temporary files

takeown /R /F "%userprofile%\AppData\Local\Temporary Internet Files"

Delete the files in the folder.

del "%userprofile%\AppData\Local\Temporary Internet Files\*"

Delete the subfolders in ‘Temporary Internet Files’

forfiles /P "%userprofile%\AppData\Local\Temporary Internet Files\*" /C "cmd /c if @isdir==TRUE rmdir /S /Q @file"

Application temporary files
@progcode
progcode / clickbot.js
Last active March 7, 2017 14:35
ClickBot.js
function simulateUserClick(url) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log('send');
}
};
xhttp.open("GET", url,true);
@progcode
progcode / magento2less.md
Last active May 24, 2017 11:25
Magento2 less

npm install -g grunt-cli

project/magento2/dev/tools/grunt/configs/themes.js

mytheme: {
    area: 'frontend',
    name: 'YourProject/Theme',

locale: 'en_US',

@progcode
progcode / ssh.md
Last active July 10, 2017 10:47
Magento2 SSH commands

Setup Upgrade Using Command Line

php bin/magento setup:upgrade

If you don’t want to remove pub/static files while installing/updating database then use following command.

php bin/magento setup:upgrade --keep-generated

Cache Clean Using Command Line

delete all hidden files -> find . -name . -o -prune -exec rm -rf -- {} +
@progcode
progcode / docker-compose.yml
Created March 7, 2019 15:16
devilbox config
##
## -------------------------
## | D E V I L S T A C K |
## -------------------------
##
## Local LAMP/LEMP stack
##
##
## ${VARIABLE:-default} will evaluate to default if VARIABLE is unset or empty in the environment.
## ${VARIABLE-default} will evaluate to default only if VARIABLE is unset in the environment.