Skip to content

Instantly share code, notes, and snippets.

View jjjjcccjjf's full-sized avatar
🎯
Focusing

endan jjjjcccjjf

🎯
Focusing
View GitHub Profile
@jjjjcccjjf
jjjjcccjjf / 0.md
Created July 22, 2017 14:07 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@jjjjcccjjf
jjjjcccjjf / php-file-write.php
Last active June 5, 2017 07:51
php file write
<?php
# Generate file
$your_data = array();
$path = "/var/www/html/";
$fp = fopen($path."arrayDetails.txt", "a");
fwrite($fp, print_r($arrayInfo,true));
fclose($fp);
@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='') {
@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

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 / 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)
@jjjjcccjjf
jjjjcccjjf / markdown.md
Created January 29, 2017 14:14 — forked from peksipatongeis/markdown.md
markdown cheat sheet
@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 / 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: