Skip to content

Instantly share code, notes, and snippets.

View kapilpipaliya's full-sized avatar
💭
making websites

kapilpipaliya

💭
making websites
View GitHub Profile
@kapilpipaliya
kapilpipaliya / machine.js
Created November 28, 2019 12:25
Generated by XState Viz: https://xstate.js.org/viz
const m = Machine({
id: 'register_context',
initial: 'initial',
context: {},
states: {
initial: {
on: {
'': [
{ target: 'redirect_dashboard', cond: 'redirect_if_logged_in' },
{ target: 'redirect_user_registration', cond: 'redirect_user' },
@kapilpipaliya
kapilpipaliya / machine.js
Created November 27, 2019 20:01
Generated by XState Viz: https://xstate.js.org/viz
const register_machine = Machine({
id: 'comp_machine',
initial: 'mounted',
context: {
},
states: {
mounted: {
entry: 'onmounted',
on: {
MOUNTED: 'bind'
@kapilpipaliya
kapilpipaliya / _etc_mail_passwd
Created November 22, 2019 05:05
my opensmtpd configuration
foo@scesoftwares.com:$6$1T.8vLPH8fuIC3FF$gtR565yUU6p2/7Cszjm5CltGMkqy4lcN1h7ekSHokY4pqBA7.41Diwjal5.VnZKl8IC0m3P075iuueK25k5LD/::::::
bar@scesoftwares.com:$6$1T.8vLPH8fuIC3FF$gtR565yUU6p2/7Cszjm5CltGMkqy4lcN1h7ekSHokY4pqBA7.41Diwjal5.VnZKl8IC0m3P075iuueK25k5LD/::::::
zoo@scesoftwares.net:$6$1T.8vLPH8fuIC3FF$gtR565yUU6p2/7Cszjm5CltGMkqy4lcN1h7ekSHokY4pqBA7.41Diwjal5.VnZKl8IC0m3P075iuueK25k5LD/::::::userdb_quota_rule=*:storage=1G
@kapilpipaliya
kapilpipaliya / MyCAF.h
Created September 14, 2019 14:41
MyCAF
#ifndef MyCAF_H
#define MyCAF_H
#include "caf/all.hpp"
#include <drogon/WebSocketController.h>
#include "mainactor.h"
#include "json.hpp"
CREATE OR REPLACE FUNCTION ee_ab1.no_branch1_delete()
RETURNS trigger AS
$$
begin
-- if id == 1 not delete
IF OLD.id = 1 THEN
RAISE EXCEPTION 'first entry cant be deleted.';
RETURN NULL;
END IF;
RETURN OLD;
module Form.Converter.FormFields where
import Effect.Console
import Control.Applicative
( pure
)
import Data.Function
( const
, ($)
> import Data.Monoid
> import Data.Foldable
> foldl append mempty ["Hello", " ", "World"]
"Hello World"
> foldl append mempty [[1, 2, 3], [4, 5], [6]]
[1,2,3,4,5,6]
defmodule SceWeb.Schema.BusinessUnitClassTypes do
@moduledoc """
"""
# give us the DSL to define graphql types
use Absinthe.Schema.Notation
# enable helpers for batching association requests.
import Absinthe.Resolution.Helpers
# alias SceWeb.Schema.Middleware
alias Sce.Business
alias Sce.Data
object :sic_queries do
@doc """
sics query returns list of all Sic rows.
the result can be filtered based on given arguments.
## Arguments
"""
field :sics, list_of(:sic) do
defmodule Sce.<%= @CS %>Resolver do
# if import_create is true i want to print some line here.
<%= create_tables_add_general(object){|rel_table, main_table, schema, prefix|
if(main_table = "Data")
import_create = true
""" import Sce.Data"""
else
""
end