Skip to content

Instantly share code, notes, and snippets.

View shakdwipeea's full-sized avatar
🎯
Focusing

Akash Shakdwipeea shakdwipeea

🎯
Focusing
View GitHub Profile
#lang racket
(struct student (roll name marks))
(define (get-input!)
(read-line (current-input-port)))
(define (get-number!) (string->number (get-input!)))
(displayln "Enter the number of students")
@shakdwipeea
shakdwipeea / init.el
Created March 17, 2019 09:41
my emacs init file
;;; init.el -- Config
;;; Commentary:
;;; custom Emacs config
;;; Code:
(let ((bootstrap-file (concat user-emacs-directory "straight/repos/straight.el/bootstrap.el"))
(bootstrap-version 3))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
@shakdwipeea
shakdwipeea / godot_ecl.c
Created December 9, 2018 09:05
godot with cl
#include <gdnative_api_struct.gen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ecl/ecl.h>
/*************/
/* Setup ecl */
/*************/
@shakdwipeea
shakdwipeea / Stack.hs
Created August 22, 2018 12:36
stack with state monad
type SimpleState = State [Int]
push :: Int -> SimpleState ()
push x = do
modify (x:)
return ()
pop :: SimpleState Int
pop = do
c <- get
@shakdwipeea
shakdwipeea / Game.hs
Created August 22, 2018 07:36
twenty eight
{-# LANGUAGE NamedFieldPuns #-}
module Lib where
import Control.Concurrent.STM
import Control.Monad
import Control.Monad.State
import Control.Concurrent.STM.TChan
import Control.Concurrent
@shakdwipeea
shakdwipeea / ufo-tank.rkt
Created July 1, 2018 10:20
move ufo and tank
(require 2htdp/image)
(require 2htdp/universe)
(require lang/posn)
(struct world (ufo tank))
(define width 500)
(define height 500)
(define mtsn (empty-scene width height))
@shakdwipeea
shakdwipeea / wheel.rkt
Created May 23, 2018 09:55
wheel movement
(require 2htdp/image)
(require 2htdp/universe)
(define background (empty-scene 200 50))
(define width-of-world 200)
(define radius-of-wheel 2)
(define distance-between-wheel (* radius-of-wheel 5))
(:require [clojure.spec.alpha :as s])
(s/def ::id string?)
(s/def ::link uri?)
(s/def ::tag (s/and string?
(complement empty?)))
(s/def ::tags (s/coll-of ::tag
:distinct true))
@shakdwipeea
shakdwipeea / core.clj
Created July 5, 2017 12:32
walk through the fs and get all references of table from a database
(ns flow.core
(:gen-class)
(:require [clojure.string :as str]))
(require '[me.raynes.fs :as fs])
;; (php? "akash.clj")
;;;;;;;;;;;;;;;;;;;;;;;;
;; identify php files ;;
@shakdwipeea
shakdwipeea / handler.clj
Created May 12, 2017 16:50
immutant async hander
(defn send-async-response [request async-handler]
(response/ok (:body (as-channel
request
{:on-open #(send! % (async-handler) {:close? true})}))))