Skip to content

Instantly share code, notes, and snippets.

View jjjjcccjjf's full-sized avatar
🎯
Focusing

endan jjjjcccjjf

🎯
Focusing
View GitHub Profile
@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 / 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 / CheckEmoji.php
Created July 24, 2017 14:31 — forked from hnq90/CheckEmoji.php
Check Emoji exist in string
/**
* Check emoji from string
*
* @return bool if existed emoji in string
*/
function checkEmoji($str)
{
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
preg_match($regexEmoticons, $str, $matches_emo);
if (!empty($matches_emo[0])) {
@jjjjcccjjf
jjjjcccjjf / ajax sample.md
Last active March 7, 2018 03:22
Ajax sample code
// GET JSON BLOCK

$.getJSON('http://localhost/api/members', function(result){ 

});
// GET JSON BLOCK
@jjjjcccjjf
jjjjcccjjf / manifest.json
Created September 29, 2017 03:57
Manifest Example for PWA
{
"name": "Amaialand",
"short_name": "Amaialand",
"icons": [{
"src": "/images/icons/icon-48x48.png",
"sizes": "48x48",
"type": "image/png"
}, {
"src": "/images/icons/icon-96x96.png",
"sizes": "96x96",
function wp_get_archives( $args = '' ) {
global $wpdb, $wp_locale;
$defaults = array(
'type' => 'monthly', 'limit' => '',
'format' => 'html', 'before' => '',
'after' => '', 'show_post_count' => false,
'echo' => 1, 'order' => 'DESC',
'post_type' => 'post'
);
/* Pagination */
div.pagination {
margin: 0 0 50px; }
div.pagination ul {
text-align: center; }
div.pagination ul li {
display: inline-block;
margin: 10px; }
div.pagination ul li a, div.pagination ul li span.current { /* @jjjjcccjjf was here*/
color: #fff;
@jjjjcccjjf
jjjjcccjjf / remove_slug.php
Created November 22, 2017 10:53
Put in functions.php wordpress
/** remove slugggg */
function na_remove_slug( $post_link, $post, $leavename ) {
if ( 'venue_cpt' != $post->post_type || 'publish' != $post->post_status ) {
return $post_link;
}
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
return $post_link;
(array) [16 elements]
0:
(array) [12 elements]
blog_id: (string) 1
domain: (string) ayalalandestates.com
path: (string) /
site_id: (string) 1
registered: (string) 2017-11-14 05:35:36
last_updated: (string) 2017-11-23 09:48:18
public: (string) 1
<?php
/* Template Name: Inquire now */
get_header();
# Block for brand & project name
$page_id = 884; # Page ID: Welcome - Ayala Group Employee
if(isset($_SESSION['employer_type']) && $_SESSION['employer_type'] == "Corporate partners")
{
$page_id = 885; # Page ID: Welcome - Corporate partners
}