Skip to content

Instantly share code, notes, and snippets.

View aadilprabhakar's full-sized avatar
💭
I may be slow to respond.

Aadil Prabhakar aadilprabhakar

💭
I may be slow to respond.
  • India
View GitHub Profile
@jpda
jpda / README.md
Last active April 18, 2024 10:34
updating vscode-postgressql to work on apple silicon

vscode-postgresql for apple silicon

The currently published version of vscode-postgresql (0.3.0) uses a very old version of pgsqltoolsservice that doesn't support Apple silicon, newer versions do but the extension is not configured to use the newer versions.

While waiting on Microsoft's team to accept a PR, there are small changes to fix this now.

  • Install the psql extension
  • Navigate to the extension root on the file system (normally ~/.vscode/extensions/ms-ossdata.vscode-postgresql-0.3.0/)
  • Update two files: config.json and platform.js
  • Reload the window or close/restart vscode
@tingwei628
tingwei628 / docker-compose.yml
Created October 27, 2019 15:20
use postgresql and pgAdmin in docker
version: "3.4"
services:
pgAdmin:
restart: always
image: dpage/pgadmin4
ports:
- "8000:80"
environment:
PGADMIN_DEFAULT_EMAIL: 1234@admin.com
@chetanppatil
chetanppatil / set-dbeaver-timezone-to-UTC.md
Last active December 19, 2023 01:34
Set dbeaver timezone to UTC (default timezone)

For Linux Users

  1. Go to directory: /usr/share/dbeaver
  2. Edit dbeaver.ini file
  3. In that file add -Duser.timezone=UTC this line under -vmargs tag
  4. Save it and restart dbeaver.
  5. Enjoy with correct date without any date conversion.

Finally your dbeaver.ini file will look like this:

@jsn789
jsn789 / add-gtm-wp.php
Last active March 28, 2023 15:38
Add Google Tag Manager through functions.php in WordPress
/* Add Google Tag Manager javascript code as close to
the opening <head> tag as possible
=====================================================*/
function add_gtm_head(){
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
@aadilprabhakar
aadilprabhakar / indian-gst-state.js
Created January 2, 2018 11:45
GST Codes for each of the Indian States as object
this.StateVsGstIndex = [
{state: 'Andaman and Nicobar Islands', gstcode: 35 },
{state: 'Andhra Pradesh', gstcode: 37 },
{state: 'Arunachal Pradesh', gstcode: 12 },
{state: 'Assam', gstcode: 18 },
{state: 'Bihar', gstcode: 10 },
{state: 'Chandigarh', gstcode: 4 },
{state: 'Chattisgarh', gstcode: 22 },
{state: 'Dadra and Nagar Haveli', gstcode: 26 },
{state: 'Daman and Diu', gstcode: 25 },
@jamiemarsland
jamiemarsland / gist:5ee8f104bc6b19ca8e14d1414549c508
Created August 10, 2017 04:15
Change the WooCommerce 'return to shop' button link (with thanks to Nicola Mustone)
/**
* Changes the redirect URL for the Return To Shop button in the cart.
*
* @return string
*/
function wc_empty_cart_redirect_url() {
return 'http://yourdomain.com/your-page/';
}
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active June 24, 2023 07:38
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 2, 2024 18:45
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@kloon
kloon / gist:4541017
Last active January 26, 2024 18:14
WooCommerce Clear Cart via URL
// check for clear-cart get param to clear the cart, append ?clear-cart to any site url to trigger this
add_action( 'init', 'woocommerce_clear_cart_url' );
function woocommerce_clear_cart_url() {
if ( isset( $_GET['clear-cart'] ) ) {
global $woocommerce;
$woocommerce->cart->empty_cart();
}
}
@boyvanamstel
boyvanamstel / youtube.lua
Created September 15, 2012 21:46
Fixed VLC youtube.lua parser
-- Apparently YouTube changed some stuff. This makes VLC play YouTube clips again.
-- Replace youtube.lua in /Applications/VLC.app/Contents/MacOS/share/playlist/youtube.lua.
-- Ticket @ VLC: https://trac.videolan.org/vlc/ticket/7471
--[[
$Id$
Copyright © 2007-2011 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by