Skip to content

Instantly share code, notes, and snippets.

View sichacvah's full-sized avatar

Курочкин Сергей sichacvah

View GitHub Profile
@sichacvah
sichacvah / queue2.c
Last active February 8, 2025 12:08
Queue Part 2
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <pthread.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>
#include <stdlib.h>
@sichacvah
sichacvah / queue.c
Created January 31, 2025 17:39
queue 1 producer and multiple consumers
typedef void* sema_handle;
typedef void (*queueentry_callback)(void*);
typedef struct queueentry queueentry;
struct queueentry {
queueentry_callback Callback;
void* userdata;
};
package ru.sergey_kurochkin.navigationcompose
import android.app.PendingIntent
import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import { Navigation } from 'react-native-navigation';
function start() {
doSomeStuff();
Navigation.startTabBasedApp({/* tabs */});
}
start();
; QUEUES
(define (front-ptr queue) (car queue))
(define (rear-ptr queue) (cdr queue))
(define (set-front-ptr! queue item) (set-car! queue item))
(define (set-rear-ptr! queue item) (set-cdr! queue item))
@sichacvah
sichacvah / VagueColorlessAfricanmolesnake.sc
Last active January 17, 2018 19:53
SICP 1.12 pascal triangle
(define (count-change amount)
(cc amount 5))
(define (cc amount kinds-of-coins)
(cond ((= amount 0) 1)
((or (< amount 0) (= kinds-of-coins 0)) 0)
(else (+ (cc amount
(- kinds-of-coins 1))
(cc (- amount (first-denomination kinds-of-coins))
kinds-of-coins)))))
(+ 1 2 3)
@sichacvah
sichacvah / gql-directives.js
Created May 2, 2017 07:14 — forked from voodooattack/gql-directives.js
GraphQL-Sequelize auto-model functionality. Directly translates the schema language into database models via directives.
const { parse, visit, print, Kind, BREAK } = require('graphql/language');
const { buildASTSchema } = require('graphql/utilities');
const { addResolveFunctionsToSchema } = require('graphql-tools');
const Sequelize = require('sequelize');
const { graphql } = require('graphql');
const jexl = require('jexl');
const deepAssign = require('deep-assign');
const { resolver: sequelizeResolver } = require('graphql-sequelize');
const { inspect } = require('util');
@sichacvah
sichacvah / AssetCatlogCreationScript.rb
Created September 23, 2016 07:23 — forked from shirishgone/AssetCatlogCreationScript
Ruby Script to create AssetCatalogs file in iOS Application.It basically fetches all the .png files from the application folder and subfolders and create a single AssetCatalog files inside the application.Most of the design developer collaboration issues will be sorted out with this script.Ask the designer to give all the assets and put into the…
require 'find'
require 'fileutils'
require 'tmpdir'
def createAssetCatalogFile()
message = '
Creating Asset Catalogs file ...'
puts message
package funsets
/**
* 2. Purely Functional Sets.
*/
object FunSets {
/**
* We represent a set by its characteristic function, i.e.
* its `contains` predicate.