Skip to content

Instantly share code, notes, and snippets.

View coderstrong's full-sized avatar
🎯
Focusing

jjeeww coderstrong

🎯
Focusing
View GitHub Profile
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
Entity Status (statecode) Status Reason (statuscode)
Account (account) 0 Active 1 Active
1 Inactive 2 Inactive
Activity (activitypointer) 0 Open 1 Open
1 Completed 2 Completed
2 Canceled 3 Canceled
3 Scheduled 4 Scheduled
Appointment (appointment) 0 Open
@coderstrong
coderstrong / wordpress-change-domain-migration.sql
Created August 30, 2020 16:53
Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. __STEP3: make sure your databa…
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
@coderstrong
coderstrong / mason.js
Created June 20, 2018 02:39 — forked from smks/mason.js
This is a sample commander CLI application used in Medium Article - How I automated my Job with Node JS
#! /usr/bin/env node
const mason = require('commander');
const { version } = require('./package.json');
const console = require('console');
// commands
const create = require('./commands/create');
const setup = require('./commands/setup');
Do you just want to search on word boundaries? If so a crude version might be:
SELECT * FROM products WHERE product_name LIKE "% foo %";
Or you could be a bit cleverer and look for word boundaries with the following REGEXP
SELECT * FROM products WHERE product_name RLIKE "[[:<:]]foo[[:>:]]";
@coderstrong
coderstrong / Logger.cs
Created January 21, 2016 02:16
My log in .NET
/***************************************
* Author : Johnny
* Date : 24/07/2014
* Learn : Singleton Design Pattern
***************************************/
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
@coderstrong
coderstrong / .gitignore
Created January 8, 2016 19:30 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@coderstrong
coderstrong / gist:fd94a40d744b73d564c4
Last active August 29, 2015 14:26 — forked from kernel1983/gist:646532
create looping background in cocos2D
-(id) init
{
if( (self=[super init] )) {
CGSize size = [[CCDirector sharedDirector] winSize];
CCTexture2D *bg = [[CCTexture2D alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
CCSprite *staticBackground0 = [CCSprite spriteWithTexture:bg];
staticBackground0.position = ccp(-size.width/2,size.height/2);
CCSprite *staticBackground1 = [CCSprite spriteWithTexture:bg];
staticBackground1.position = ccp(size.width/2,size.height/2);
@coderstrong
coderstrong / html5template.html
Created October 24, 2012 06:10 — forked from rwbaker/html5template.html
HTML5 Template
<!doctype html>
<!--[if lt IE 7]> <html class="ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="ie8 oldie" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">