Skip to content

Instantly share code, notes, and snippets.

Importing a Git repository using the command line

Before you start, make sure you know:

  • Your GitHub username
  • The clone URL for the external repository, such as https://external-host.com/user/repo.git or git://external-host.com/user/repo.git (perhaps with a user@ in front of the external-host.com domain name)

For purposes of demonstration, we'll use:

  • An external account named extuser
  • An external Git host named https://external-host.com
@albertpark
albertpark / git-pushing-multiple.md
Last active May 7, 2020 20:18 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

Updated May 7, 2020

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

Using command-line Git with GitHub 2FA

Updated Apr 18, 2020

After enabling two-factor authentication on my GitHub account it seemed I became unable to push my local repositories from command-line git using the https transport.

I was simply wrong, here what I did to fix the issue.

Create a Personal Access Token

Two-factor authentication in GitHub works by replacing your GitHub password with a Personal Access Token which can be different depending on the application you want to enable.

@albertpark
albertpark / license
Last active May 11, 2020 21:06 — forked from defunkt/license
license bash script
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Albert Park
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
zip -r folder1 folder1 -x exclude1 exclude2

Must know Git commands

Updated Apr 29, 2020

Show differences

If you want see the differences between local and remote files:

$ git diff master origin/master

To do so, specify the -r (or --recursive) option:

$ cp -r ../.git .

$#, $@ & $?: Bash Built-in variables

file:test.sh
#! /bin/sh
echo '$#' $#
echo '$@' $@
echo '$?' $?

*If you run the above script as*

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:

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