Skip to content

Instantly share code, notes, and snippets.

View jjjjcccjjf's full-sized avatar
🎯
Focusing

endan jjjjcccjjf

🎯
Focusing
View GitHub Profile
@jjjjcccjjf
jjjjcccjjf / captcha_example.php
Last active February 5, 2018 01:48
Google ReCAPTCHA example
# Get your API key here
https://www.google.com/recaptcha/admin#list
# This is the main captcha url
# Put on your <head> tag
# Omit this if you're using the code block below
<script src="https://www.google.com/recaptcha/api.js"></script>
# This is a script for multiple captchas on the same page
# Put on <head> tag
@jjjjcccjjf
jjjjcccjjf / git-adding-to-remote.md
Last active January 29, 2017 07:46
How to add remote repository from working copy

#git init

#git add . Adds the files in the local repository and stages them for commit

#git commit -m 'First commit' Commits the tracked changes and prepares them to be pushed to a remote repository

git remote add origin

Sets the new remote

@jjjjcccjjf
jjjjcccjjf / mysql-import-export-ssh.md
Created January 29, 2017 07:47
Importing/Exporting a MySQL database via SSH

Exporting a MySQL database

To export a MySQL database, you need to use the mysqldump command. Here is the full command for exporting your database:

mysqldump -uUSERNAME -pPASSWORD DATABASE > backup.sql

Importing a MySQL database

To import a MySQl database, you need to use the mysql command. Here is the full command for importing a MySQL dump into a database:

@jjjjcccjjf
jjjjcccjjf / git-cheat-sheet.md
Last active October 14, 2022 09:47
GIT CHEAT SHEET by TOWER - www.git-tower.com

CREATE

Clone an existing repository

$ git clone ssh://user@domain.com/repo.git

Create a new local repository

$ git init

LOCAL CHANGES

@jjjjcccjjf
jjjjcccjjf / markdown.md
Created January 29, 2017 14:14 — forked from peksipatongeis/markdown.md
markdown cheat sheet
@jjjjcccjjf
jjjjcccjjf / wordpress.php
Created March 6, 2017 07:29
Wordpress code snippets
<?php //Default WordPress
the_post_thumbnail( 'thumbnail' ); // Thumbnail (150 x 150 hard cropped)
the_post_thumbnail( 'medium' ); // Medium resolution (300 x 300 max height 300px)
the_post_thumbnail( 'medium_large' ); // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
the_post_thumbnail( 'large' ); // Large resolution (1024 x 1024 max height 1024px)
the_post_thumbnail( 'full' ); // Full resolution (original size uploaded)
//With WooCommerce
the_post_thumbnail( 'shop_thumbnail' ); // Shop thumbnail (180 x 180 hard cropped)
the_post_thumbnail( 'shop_catalog' ); // Shop catalog (300 x 300 hard cropped)

How to set up scotch box using Vagrant

$ git clone https://github.com/scotch-io/scotch-box your-project

$ cd your-project

$ vagrant up

Got to http://192.168.33.10/

@jjjjcccjjf
jjjjcccjjf / .gitignore
Created April 6, 2017 09:34 — forked from redoPop/.gitignore
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@jjjjcccjjf
jjjjcccjjf / wp-pagination.php
Last active September 24, 2020 03:19
Wordpress pagination code snippet
############################# function-pagination.php ##########################
<?php
/**
* @link: http://callmenick.com/post/custom-wordpress-loop-with-pagination
* Create this as a separate file function-pagination.php
*/
function custom_pagination($numpages = '', $pagerange = '', $paged='') {