Skip to content

Instantly share code, notes, and snippets.

View hasinhayder's full-sized avatar
🚀
Back on track, yayyyy!

Hasin Hayder hasinhayder

🚀
Back on track, yayyyy!
View GitHub Profile
@ivanvermeyen
ivanvermeyen / !NOTE.md
Last active March 15, 2023 05:25
Setup a Laravel Storage driver with Google Drive API
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
{
return $next($request);
}
@homam
homam / imgur-example.html
Last active September 26, 2022 06:08
html2canvas example
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
<form method="POST" enctype="multipart/form-data" action="https://www.google.com/save" id="myForm">
<input type="hidden" name="img_val" id="img_val" value="" />
</form>
<div id="more">
<h1 style='color: red'> hello </h1>
<iframe src="https://tags.mli.me/12751">
</iframe>
<?php
/**
* Plugin Name: Customize Post Preambles
* Author: Weston Ruter, XWP
* Description: Demo plugin for Customize Posts to add a section before each post in The Loop that contains a preamble content stored in postmeta.
*
* @package CustomizePostPreambles
*/
namespace CustomizePostPreambles;
@milon
milon / .gvimrc
Last active August 8, 2017 10:10
My .vimrc file
set guifont=Fira_Code:h15 " font for mac vim
set linespace=14 " line spacing for macvim
set macligatures " Fira code symbols enables
set guioptions-=e " Disable GUI tabs
" remove any scrollbar
set guioptions-=L
set guioptions-=l
set guioptions-=R
set guioptions-=r
@obiPlabon
obiPlabon / i18n.php
Created March 3, 2016 10:15
WordPress I18N Functions
<?php
__
_e
_ex
esc_attr__
esc_attr_e
esc_attr_x
esc_html__
esc_html_e
esc_html_x
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active April 29, 2025 12:40
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@migrs
migrs / Kernel.php
Last active April 9, 2017 20:46
newrelic patch for laravel5.2
<?php namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
protected $middleware = [
\App\Http\Middleware\NewRelicPatch::class,
//... your other middlewares
];
@ms-studio
ms-studio / add-term-to-custom-taxonomy.php
Created December 15, 2015 08:10
add term metabox to custom taxonomy - using WP 4.4 term meta functions
<?php
// source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy
// code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup
// CREATE CUSTOM TAXONOMY
add_action( 'init', '___create_my_custom_tax' );
@shitpoet
shitpoet / create_order.php
Created December 3, 2015 19:09
Programmatically create order, add (variative) products from cart to it, change status to `processing` and empty cart. Wordpress, WooCommerce 2.4.
$address = array(
'first_name' => $customer_name,
'last_name' => '',
'company' => '',
'email' => $customer_email,
'phone' => $customer_phone,
'address_1' => '',
'address_2' => '',
'city' => '',
'state' => '',