Skip to content

Instantly share code, notes, and snippets.

View 6220119's full-sized avatar
🌴

Nguyen Vu Cuong (Ralph) 6220119

🌴
View GitHub Profile
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
<?php
/*
* Copyright (c) @ ShareFBScripts.BlogSpot.Com
* Author: AnCMS
* Date: 2/8/2016
*/
if(array_key_exists('t',$_GET)){
header("Content-type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
@6220119
6220119 / [comment]-add.js
Last active February 14, 2017 07:28
JIRA scripts (JIRA v1000.747.1)
(function () {
var assignee = $('#assignee-val > span').attr('rel');
if (assignee) {
$('#footer-comment-button').click();
$('#comment').val('[~' + assignee + '], This is an auto-generated comment, please add submitted change list number, Reviewed by, root cause analysis and solution if applicable');
$('#issue-comment-add-submit').enable().click();
} else {
alert('No assignee!');
}
})();
git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global http.proxy http://proxy.mycompany:80
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm config set registry http://registry.npmjs.org/
automatic proxy script can be located using chrome://net-internals/#proxy
Thanks http://artica-proxy.com/how-to-debug-proxy-pac-with-google-chrome/
CSS:
- Use 'media' to async load stylesheets. By default, it is 'media="all"', use loadCSS lib for compatibility (note the Edge Issues)
- @font-face's FOUT problem can be resolved with FontFaceObserver. Tip: when fonts are loaded, add a class to body to have respective elements displayed in desired font-family.
// Will match dates with dashes, slashes or with spaces dd-mm-yyyy dd/mm/yyyy dd mm yyyy
/^(0?[1-9]|[12][0-9]|3[01])([ \/\-])(0?[1-9]|1[012])\2([0-9][0-9][0-9][0-9])$/
// Match times in 24 hour format
/([01]?[0-9]|2[0-3]):[0-5][0-9]/
// Will match a valid date and times in the ISO-8601 format, excludes durations.
/^(?![+-]?\d{4,5}-?(?:\d{2}|W\d{2})T)(?:|(\d{4}|[+-]\d{5})-?(?:|(0\d|1[0-2])(?:|-?([0-2]\d|3[0-1]))|([0-2]\d{2}|3[0-5]\d|36[0-6])|W([0-4]\d|5[0-3])(?:|-?([1-7])))(?:(?!\d)|T(?=\d)))(?:|([01]\d|2[0-4])(?:|:?([0-5]\d)(?:|:?([0-5]\d)(?:|\.(\d{3})))(?:|[zZ]|([+-](?:[01]\d|2[0-4]))(?:|:?([0-5]\d)))))$/
// Match opening and closing HTML tags with content between
@6220119
6220119 / README-Template.md
Created January 8, 2018 04:48 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@6220119
6220119 / Patching `proactor_events.py`
Created January 23, 2018 07:41
Fix the BlockingIOError on Python for Windows
--- proactor_events.py 2018-01-23 13:55:46.665000000 +0700
+++ proactor_events_fixed.py 2018-01-23 12:22:08.319000000 +0700
@@ -493,7 +493,23 @@
f.add_done_callback(self._loop_self_reading)
def _write_to_self(self):
- self._csock.send(b'\0')
+ # Original code
+ # self._csock.send(b'\0')
+
@6220119
6220119 / Instructions.md
Created January 23, 2018 08:44 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@6220119
6220119 / GitHub-Forking.md
Created January 23, 2018 09:13 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j