Skip to content

Instantly share code, notes, and snippets.

View arafathusayn's full-sized avatar
👨‍💻
Focusing

Arafat Husayn arafathusayn

👨‍💻
Focusing
View GitHub Profile
@arafathusayn
arafathusayn / Open with SublimeText3.bat
Created October 5, 2017 07:42
Add "Open with SublimeText3!" to every context menu (right-click files, folders, current folder) on Windows OS
@echo off
SET st3_path=C:\Program Files\Sublime Text 3\sublime_text.exe
SET st3_label=Open with SublimeText3!
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "%st3_label%" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3_path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3_path% \"%%1\"" /f
rem add it for folders
@arafathusayn
arafathusayn / gist:53595a737f929860338c08361b0d028d
Created October 15, 2017 11:39 — forked from mrbobbybryant/gist:f1714ab93b8171947ed7
WordPress Custom Post Type (Using $singular and $plural)
<?php
//Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function dwwp_register_post_type() {
$singular = 'Job';
$plural = 'Jobs';
@arafathusayn
arafathusayn / gulpfile.js
Created October 18, 2017 08:11
Laravel View Files Minification (HTML, CSS & JS) with Gulp
// > gulp minify
const htmlmin = require('gulp-htmlmin')
const gulp = require('gulp')
gulp.task('minify', () => {
const opts = {
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
@arafathusayn
arafathusayn / bookmarklet.js
Created October 19, 2017 08:17
Wanna run your Javascript snippets on your mobile offline? Save this bookmarklet in your mobile browser bookmarks. You may navigate to about:blank first to get a blank page to run the bookmarklet on it. Start typing your bookmark name which contains the 'javascript:' code below as URL in your address bar and tap on it. Then start playing!
javascript:document.body.innerHTML=`<div style='border-radius:10px;height:290px;width:600px;margin:auto;padding:10px;background-color:green;'> <textarea style='border:1px solid green;border-radius:5px;margin:auto;padding:5px;width:600px;height:290px;' onkeyup='(new Function(this.value.trim()))()' onfocus='(new Function(this.value.trim()))()'>\n\n\n\n\n\n\n\ndocument.getElementById('r').innerText = "Hello!"</textarea> <div id='r' style='font-size:24px;font-weight:bold;padding:30px;margin-top:30px;text-align:center;border:2px solid green;' ></div> </div>`
@arafathusayn
arafathusayn / vs-js-snippets.json
Created November 9, 2017 13:07
VS Code custom snippets for Javascript
{
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
@arafathusayn
arafathusayn / Android USB Debugging.md
Last active November 25, 2017 16:25
[React Native Android] yarn run usb or, npm run usb (Linux or MacOS)

Add the code below to your npm scripts in package.json

"usb": "react-native run-android --deviceId $(adb devices | grep -oP '[0-9a-zA-Z]{7,30}\t')",

Example:

"scripts": {
  "start": "node node_modules/react-native/local-cli/cli.js start",
 "usb": "react-native run-android --deviceId $(adb devices | grep -oP '[0-9a-zA-Z]{7,30}\t')",
@arafathusayn
arafathusayn / xampp_php7_xdebug.md
Created February 1, 2018 12:57 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

@arafathusayn
arafathusayn / git_add_commit_push.bat
Created February 8, 2018 08:26
Urgent git add all, commit with a random number and push with a single command on Windows OS
@echo on
git pull
set /a num=%random% %%1000 +1
git add . && git commit -m %num%
git push
@arafathusayn
arafathusayn / vscode_git_fix_cmd.bat
Created February 8, 2018 08:32
Fix VS Code git push issue on Windows OS with a double-click
@echo on
cd /d %~dp0
start-ssh-agent /k "code ."

Keybase proof

I hereby claim:

  • I am arafathusayn on github.
  • I am arafat (https://keybase.io/arafat) on keybase.
  • I have a public key ASCAl2rgSBku1FZa9xPD203tD417_uspLVH5e5_Sdg3fQgo

To claim this, I am signing this object: