Skip to content

Instantly share code, notes, and snippets.

View daubac402's full-sized avatar
🇻🇳
🎄

NguyenTheAnh daubac402

🇻🇳
🎄
View GitHub Profile
@meeDamian
meeDamian / shorten.php
Created December 20, 2011 08:39
[ PHP | api | google ] goo.gl link shortenter
<?
// add it to config file:
$google_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
// add this to libs file:
function shorten($url) {
$gurl = "https://www.googleapis.com/urlshortener/v1/url?key=" . $GLOBALS['google_key'];
$url = json_encode(array("longUrl" => $url));
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@niksumeiko
niksumeiko / git.migrate
Last active July 19, 2024 21:32
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@daubac402
daubac402 / Numpad_plus_TOGGLE_w_button.ahk
Last active October 17, 2023 08:49
Toggle Auto holding W key (accelerator key) for GTA Online (turn on/off by Numpad Add key) (require: AutoHotkey)
timer_cb:
{
SetKeyDelay, -1
if (toggle_flag) {
Send, {Blind}{w DownTemp}
} else {
SetTimer, timer_cb, OFF
Send, {Blind}{w UP}
}
}
@daubac402
daubac402 / self-signed-certificate-with-custom-ca.md
Last active April 7, 2021 05:45 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

1. Create Root CA (Done once)

1.1. Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@daubac402
daubac402 / minification.md
Created April 9, 2021 08:42 — forked from gaearon/minification.md
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal: