- http://stackoverflow.com/questions/804115 (
rebasevsmerge). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebasevsmerge) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse) - http://stackoverflow.com/questions/292357 (
pullvsfetch) - http://stackoverflow.com/questions/39651 (
stashvsbranch) - http://stackoverflow.com/questions/8358035 (
resetvscheckoutvsrevert)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Wraper to upload binary files to GitHub repo | |
| * Uses the modified GitHub library under the hood and exposes it as `GHInstance` property for get instance of all methods | |
| * @note: | |
| * -- inspired at article: @see <https://medium.freecodecamp.org/pushing-a-list-of-files-to-the-github-with-javascript-b724c8c09b66> | |
| * -- issue (not yet resolved): @see issue <https://github.com/github-tools/github/issues/417> | |
| * @copyright Copyright (c) 2020 Lauro Moraes <https://github.com/subversivo58> | |
| * @license MIT License <https://github.com/subversivo58/subversivo58.github.io/blob/master/LICENSE> | |
| */ | |
| const GithubAPI = function(auth) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * playground | |
| * | |
| * functionnal use is at the bottom. | |
| * | |
| * Don't damn me, that's a playground. | |
| */ | |
| class Pipe { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| <style media="screen"> | |
| html,body{ | |
| font-family: monospace; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)) { | |
| //is IE 11 or below | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class BackupDatabaseCronModuleFrontController extends ModuleFrontController | |
| { | |
| public function init() | |
| { | |
| try { | |
| $this->checkAccess(); | |
| $this->module->cron(); | |
| header( "backup ok", true ,200 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Uses the https://github.com/github-tools/github library under the hood and exposes it as `gh` property | |
| function GithubAPI(auth) { | |
| let repo; | |
| let filesToCommit = []; | |
| let currentBranch = {}; | |
| let newCommit = {}; | |
| //the underlying library for making requests | |
| let gh = new GitHub(auth); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Based on https://www.tomas-dvorak.cz/posts/nodejs-request-without-dependencies/ | |
| import * as https from "https"; | |
| async function httpsExchange(requestOptions: https.RequestOptions): Promise<string> { | |
| return new Promise<string>((resolve, reject) => { | |
| const request = https.request(requestOptions, (response) => { | |
| if (response.statusCode < 200 || response.statusCode > 299) { | |
| reject(new Error("Non-2xx status code: " + response.statusCode)); | |
| } |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Delete all logs | |
| TRUNCATE ps_log; | |
| # Delete old connection data (only used for stats) | |
| # change 2016-02-01 00:00:00 according to you needs | |
| DELETE c, cs | |
| FROM ps_connections c | |
| LEFT JOIN ps_connections_source cs ON (c.id_connections = cs.id_connections) | |
| WHERE c.date_add < '2016-02-01 00:00:00'; |