Skip to content

Instantly share code, notes, and snippets.

View prikhi's full-sized avatar

Pavan Rikhi prikhi

View GitHub Profile
@prikhi
prikhi / Main.elm
Created June 19, 2019 03:02
Star Wars Galaxy of Heroes - Mods to CSV
module Main exposing (main)
import Browser
import Html exposing (..)
import Html.Attributes exposing (type_, value)
import Html.Events exposing (onInput, onClick)
import Http exposing (jsonBody, expectJson)
import Json.Encode as Encode
import Json.Decode as Decode
@prikhi
prikhi / README.md
Created August 2, 2018 01:22
AirVPN Eddie-UI systemd Service
  1. Create config directory: mkdir /etc/airvpn/
  2. Move your Default.xml over: mv ~/.airvpn/Default.xml /etc/airvpn
  3. Create /etc/systemd/system/eddie-ui.service
  4. Enable your -wait-online service
  5. Enable & start the eddie-ui.service unit: systemctl enable eddie-ui.service; systemctl start eddie-ui.service
  6. Verify connection by following log: journalctl -u eddie-ui.service -n50 -f
@prikhi
prikhi / LawsCheckingSpec.hs
Created October 19, 2017 20:55
roelof hspec
module LawsCheckingSpec (spec) where
import Test.Hspec
spec :: Spec
spec =
describe "laws testing" $
it "1 + 1 == 2" $
1 + 1 `shouldBe` (2 :: Integer)
@prikhi
prikhi / PietRectangles.hs
Created August 19, 2017 03:17
Book Of Shaders & Hylogen/Hylide - Piet Exercise
{-# LANGUAGE GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
module PietRectangles where
import Hylogen.WithHylide
black :: Vec4
black =
vec4 (0.0, 0.0, 0.0, 1.0)
@prikhi
prikhi / CMakeLists.txt
Created August 3, 2017 22:41
Building Cyril on Arch Linux
cmake_minimum_required(VERSION 3.5)
project(cyril)
set(APP_NAME cyril)
set(BUNDLE_NAME "cyril")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
add_compile_options(-Wno-deprecated-declarations)
add_compile_options(-Wno-delete-incomplete)
add_compile_options(-Wno-conversion-null)
@prikhi
prikhi / wc-custom-purchased-column.php
Last active June 15, 2020 06:24 — forked from rynaldos-zz/wc-custom-purchased-column.php
[WooCommerce 3.0+] Re-instate the "Purchased items" column on orders page
<?php
/** Add a Purchased Column w/ Item Quantity, SKU, Name, & Meta to the Admin Orders Table **/
class ThemeWooCommerce
{
/* Add a `Purchased` Column to the Admin Orders Table */
public static function add_purchased_column_header($columns) {
$new_columns = array();
foreach ($columns as $key => $title) {
if ($key === 'billing_address') {
$new_columns['order_items'] = __('Purchased', 'woocommerce');
@prikhi
prikhi / wpadverts_expiration_renewal_emails.php
Created April 10, 2017 02:33
Wordpress WPAdverts: Automatically Send Expiration & Renewal Emails
<?php
/** Send Reminder & Renewal Emails for Ads that will expire in the next 5/1/0
* days.
*
* This script is run daily by cron.
*/
require_once '../../../../wp-load.php';
@prikhi
prikhi / awpcp_to_wpadverts_migration.php
Created April 10, 2017 00:21
Wordpress Ad Plugin Migration: Transfer AWPCP Ads to WPAdverts
<?php
/** This script transfers all active ads from the AWPCP Wordpress plugin into
* the WPAdverts plugin.
*
* It assumes you've already created the new WP-Adverts categories & payment
* products. You should update the ids of the AWPCP & WPAdverts categories and
* payments via the $category_map and $payment_map variables.
*
* License: GPL-3
*/
type FilterMsg
= UpdateTitleFilter String
| UpdateDescriptionFilter String
| UpdateTagFilter String
type Msg
= Filter FilterMsg
| DoSomethingElse