Skip to content

Instantly share code, notes, and snippets.

View hlaporthein's full-sized avatar
💭
I may be slow to respond.

hlaporthein hlaporthein

💭
I may be slow to respond.
View GitHub Profile
@hlaporthein
hlaporthein / p-by-no-meta-record.sql
Created October 5, 2020 07:55
post by no meta record exist in wordpres
$query = "SELECT p.id from $wpdb->posts p WHERE p.id NOT IN ( SELECT m.post_id FROM $wpdb->postmeta m WHERE m.meta_key = 'date_taken')
AND post_status IN ('inherit', 'publish')
AND post_type IN ('galleries', 'attachment')"; //only post ids not the whole post in selection
$the_query = $wpdb->get_results($query);
@hlaporthein
hlaporthein / Response.php
Created August 15, 2020 13:30 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@hlaporthein
hlaporthein / laravel.js
Created June 8, 2020 11:16 — forked from JeffreyWay/laravel.js
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@hlaporthein
hlaporthein / emojis.json
Created May 14, 2020 15:34 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👦‍👦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw
@hlaporthein
hlaporthein / uicollectionview.swift
Created April 18, 2020 13:55
UICollectionview Dynamically
//
// DumyViewController.swift
// JoJoInventory
//
// Created by Hla Por Thein on 18/04/2020.
// Copyright © 2020 FlexTech. All rights reserved.
//
import UIKit
@hlaporthein
hlaporthein / nginx.conf
Created March 11, 2020 07:16 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@hlaporthein
hlaporthein / .bash_profile
Created March 14, 2019 06:25 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@hlaporthein
hlaporthein / remove-node&npm.bash
Last active March 6, 2019 08:15
remove Node & NPM commands
rm -rf ~/.npmrc
rm -rf ~/.npm
rm -rf ~/.node-gyp
rm -rf ~/.node_repl_history
rm -rf ~/node-modules
rm -rf ~/.npm-global
rm -rf ~/.npm
rm -rf ~/.npmrc
rm -rf ~/global-modules
rm -rf ~/npm-global
@hlaporthein
hlaporthein / .gitignore
Created October 17, 2018 22:47 — forked from salcode/.gitignore
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@hlaporthein
hlaporthein / scopes.txt
Created June 22, 2018 04:13 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee