Skip to content

Instantly share code, notes, and snippets.

View OhYash's full-sized avatar
🏠
Working from home

Yash Yadav OhYash

🏠
Working from home
View GitHub Profile
@OhYash
OhYash / ava_test_test.js
Last active May 26, 2021 20:41
ava test test
// Global timeout 10s
const test = require('ava');
const delay = (d) => new Promise((r) => setTimeout(r, d));
test('foo', async t => {
await delay(6000);
t.pass();
});
// Passes
@OhYash
OhYash / PKGBUILD
Last active December 28, 2017 19:18
During efl-git compilation, two different errors for the same code compilation
$ makepkg -s
.
.
.
.
.
.
EOLIAN lib/efl/interfaces/efl_ui_scrollable_interactive.eo.c
eolian: efl_ui_scrollable_interactive.eo:100:20: undefined type Efl.Ui.Scroll_Block
eolian: could not parse file 'lib/efl/interfaces/efl_ui_scrollable_interactive.eo'
@OhYash
OhYash / $gcc
Created December 28, 2017 18:26
Occurs when I try to compile any elem program
In file included from /usr/include/elementary-1/elm_radio.h:71:0,
from /usr/include/elementary-1/Elementary.h:247,
from etodo.c:1:
/usr/include/elementary-1/elm_radio_legacy.h:30:59: error: unknown type name ‘Efl_Ui_Radio’
EAPI int elm_radio_value_get(const Efl_Ui_Radio *obj);
@OhYash
OhYash / ball_move.c
Created November 16, 2017 05:14
Name and Mouse/Keyboard event (16/11/17)
#include<GL/glut.h>
#include<stdio.h>
#include<stdlib.h>
float tx=0.0, ty=-0.7;
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
@OhYash
OhYash / sutherland.c
Created October 26, 2017 05:30
Sutherland ine clipping
#include<GL/glut.h>
#include<stdio.h>
int x0, x1, y0, y1;
void inplinexoordinates()
{
printf("Enter Line end coordinates (x0, y0, x1, y1) : ");
scanf("%d %d %d %d", &x0, &y0, &x1, &y1);
}
@OhYash
OhYash / bounce.c
Last active October 12, 2017 04:52
Predefined items rotation, windmill and bouncing ball
#include<GL/GLUT.h>
float ty=-1, flag=0;
void draw()
{
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@OhYash
OhYash / midpointellipse.c
Created September 14, 2017 05:13
ellipse and transformations
#include<GL/glut.h>
void drawellipse(int x0, int y0, int rx, int ry)
{
double p1 = (double)(ry*ry - rx*rx*ry + rx*rx/4);
int x = 0;
int y = ry;
glBegin(GL_POINTS);
while(ry*ry*x < rx*rx*y)
{
@OhYash
OhYash / bresenhamline.c
Created September 7, 2017 05:20
Bresenham n midpoint line
#include<GL/glut.h>
void drawline(int x0, int y0, int x1, int y1)
{
double dx = (double)(x1-x0);
double dy = (double)y1-y0;
double p = 2*dy - dx;
int k = (int)dx;
int x = x0, y = y0;
glBegin(GL_POINTS);
@OhYash
OhYash / Description
Created August 4, 2017 07:10
Error with file reading
-> No compilation errors
So when I run it, this block inside the else of etodo.c program crates the error.
i.e. If I remove this while block, the program runs.
while(!feof(fp))
{
fgets(reader, 51, fp);
elm_list_item_append(list, reader, NULL, NULL, NULL, NULL);
}
@OhYash
OhYash / EConnMan.log
Last active August 9, 2017 16:14
Errors in efl apps
Error Information:
An exit code of 1 was returned from econnman-bin.
Output Data:
There was no output
Error Logs:
There was no error message