Skip to content

Instantly share code, notes, and snippets.

View virajsoni06's full-sized avatar
🎯
Focusing

Viraj virajsoni06

🎯
Focusing
View GitHub Profile
@swport
swport / woocommerce_payment_process_rest.php
Last active June 25, 2023 06:31
WordPress Rest API endpoint to process payments via WC
<?php
/*
* Suitable for NON-HOSTED payment gateways wallets, funds, etc.
*
* You can also process HOSTED payment gateways like paypal, but you'll get a rediect URL at the end
* and you have to handle that depending on what client (android, ios) you're catering to.
* You can have the redirect URL open up in a web-view-client and collect payment.
*
**/
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active April 21, 2025 09:17
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.
@smeric
smeric / woocommerce-membership-post-excerpt.php
Created November 23, 2015 14:06
WooCommerce membership custom post excerpt. Instead of using the excerpt this will display the begining of a post for non members.
<?php
/**
* Plugin Name: WooCommerce membership custom post excerpt
* Description: Instead of using the excerpt this will display the begining of a post for non members.
* Version: 0.1
* Author: Sébastien Méric <[email protected]>
* Author URI: http://www.sebastien-meric.com/
**/
defined( 'ABSPATH' ) OR exit;
@staltz
staltz / introrx.md
Last active April 21, 2025 04:15
The introduction to Reactive Programming you've been missing
@soheilhy
soheilhy / nginxproxy.md
Last active April 11, 2025 06:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@lrobeson
lrobeson / _fonts.scss
Created October 3, 2013 21:34
Sass partial - font face declarations for cloud.typography.com hosted fonts
/**
* @file
* Font face declarations for Typography.com hosted fonts
*/
/* replace this URL, it will be specific to each project */
@import "//cloud.typography.com/123456/789123/css/fonts.css";
/* Gotham Bold */
@font-face {
@hofmannsven
hofmannsven / README.md
Last active April 1, 2025 06:51
Git CLI Cheatsheet
@ludder
ludder / slideDown.js
Created December 6, 2012 17:25
Vanilla JavaScript slideUp and slideDown functions
/*
Element to slide gets the following CSS:
max-height: 0;
opacity: 0;
overflow: hidden;
transition: max-height 0.4s ease 0s;
*/
/**
* Like jQuery's slideDown function - uses CSS3 transitions