Skip to content

Instantly share code, notes, and snippets.

@albertpark
albertpark / ud_filter.js
Created August 20, 2021 21:32
Filter available domains on uniteddomains.com
/***
uniteddomains.com
collect domain names with the shortest tld first and sort it by price (also handles duplicate names)
collect all the available domain and group them by the length of the tld
then sort them by price and alphabetical order
***/
(() => {
"use strict";

Ignore Files During Git Merge

→ $ git merge --no-ff --no-commit <merge-branch>
→ $ git reset HEAD ignorefilemerge.txt
→ $ git checkout -- ignorefilemerge.txt
→ $ git commit -m "merged <merge-branch>"

https://stackoverflow.com/a/16455853

Systemctl Status Service Logs

Just use the journalctl command, as in:

→ $ journalctl -u service-name.service

Or, to see only log messages for the current boot:

→ $ journalctl -u service-name.service -b

Git Merge To FF Or Not To FF

Created May 13, 2020

Intro

In git merge there are several ways to merge branches however, the most commonly used options are --ff-only and --no-ff. The --ff-only option will resolve the merge as a fast-forward when possible. When not possible, it refuses to merge and will exit with a non-zero status. Best examples used by this options are branches from features and hotfixes.

Merge develop to master

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Git Merge Bubbles Nightmare

Updated May 12, 2020

Intro

So I complete a script program that works wonders on a Windows OS. Great! Next I test it on a Linux OS. I clone my repository on a Linux machine and test the code. What do you know, there is a bug and the code crashes immediately. Story of every coder's life. I do what we must do and dig into the code to fix this issue. I modify the code and re-test it. The bug is fixed and update the code. I send out a command with a git commit followed by a git push back to the remote. Now I am back to my Windows machine to make sure it did not break anything. I do a git pull and test the code. Something is not quiet right so I do this couple times back and forth to make sure I cover all the cases. Everything is perfect!

Well I was dead wrong. I have fallen into the newbie git pit and create git merge bubbles. In case you are wondering what they look like they look horrendus. Here was my first newbie git merge bubbles.

License Types

License License keyword
Academic Free License v3.0 afl-3.0
Apache license 2.0 apache-2.0
Artistic license 2.0 artistic-2.0
Boost Software License 1.0 bsl-1.0
BSD 2-clause "Simplified" license bsd-2-clause
BSD 3-clause "New" or "Revised" license bsd-3-clause

Extract Anything in Git Repositories - Including History

Updated May 6, 2020

I came across few files or folders I felt that was better suited in a different project; in my case in another repository. Simple way would be to just copy the files over to the new or existing repositories. This will just act as a new file with no history and perhaps someone with a sharp eye may see this as a copy pasta code from somewhere in the internet. After searching the web I found out there was an amazing method to do this with retaining the history of the file. Through some research I have come up with a simple way to accomplish this goal.

Extract any files

These are the step all you need to know how to extract files with persevering its history. First we will clone the desired repository which contains the files we want to extract:

Manually installing PHP 5.4 for WampServer

This thread is a bit old but I'll give the procedure here, as it match to the original question.

I'll take PHP 5.4.13 for my example (currently the most recent 5.4 version)

Download binaries on php.net Extract all files in a new folder : C:/wamp/bin/php/php5.4.13/ Copy the wampserver.conf from another php folder (like php/php5.2.8/) to the new folder Rename php.ini-development file to phpForApache.ini

PHP Difference between Thread Safe and Non-Thread Safe for Windows

From PHP documentation:

Thread Safety means that binary can work in a multithreaded webserver context, such as Apache 2 on Windows. Thread Safety works by creating a local storage copy in each thread, so that the data won't collide with another thread.

So what do I choose? If you choose to run PHP as a CGI binary, then you won't need thread safety, because the binary is invoked at each request. For multithreaded webservers, such as IIS5 and IIS6, you should use the threaded version of PHP.

So it really depends on the way that you want to use PHP: