Skip to content

Instantly share code, notes, and snippets.

View shakdwipeea's full-sized avatar
🎯
Focusing

Akash Shakdwipeea shakdwipeea

🎯
Focusing
View GitHub Profile
@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 / 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 / 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 / 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 / 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
#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")
(import :std/foreign)
(export #t)
(begin-ffi (first-c
malloc-integer-list)
(define-c-lambda first-c
((pointer (pointer int)))
(pointer int)
@shakdwipeea
shakdwipeea / strings.ss
Created September 12, 2019 09:59
ffi macros
(import :std/foreign)
(import (for-syntax :play/stxutil))
(export #t)
(begin-ffi ()
(c-declare "#include<string.h>"))
(defsyntax (access stx)
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - lights - hemisphere light</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="main.css">
<style>
body {
color: #444;
(define data (list 0.0 -0.5 1.0 0.0 0.0
0.5 0.5 0.0 1.0 0.0
-0.5 0.5 0.0 0.0 1.0))
(define buffer-data (let (v (make-u8vector (* 15 4)))
(let lp ((rest data) (i 0))
(match rest
([x . rest]
(displayln "i:" i "x:" x)