Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
Alive!!!

Rafi Rafi993

🤖
Alive!!!
View GitHub Profile
View useContextMenu.js
import { useEffect, useCallback, useState } from "react";
const useContextMenu = outerRef => {
const [xPos, setXPos] = useState("0px");
const [yPos, setYPos] = useState("0px");
const [menu, showMenu] = useState(false);
const handleContextMenu = useCallback(
event => {
event.preventDefault();
View application_controller.rb
class ApplicationController < ActionController::Base
end
@Rafi993
Rafi993 / vscodeSnippetGenerator.js
Created Jan 9, 2020
vscode snippet generator from markdown
View vscodeSnippetGenerator.js
const fs = require("fs").promises;
const path = require("path");
const listFiles = async folderName => {
const markDownFiles = (await fs.readdir(folderName)).filter(file =>
file.includes(".md")
);
let snippet = {};
View trained model
{
"modelTopology": {
"backend": "tensorflow",
"training_config": {
"loss_weights": null,
"loss": "categorical_crossentropy",
"metrics": ["accuracy"],
"optimizer_config": {
"config": {
"rho": 0.8999999761581421,
View JJd8-0.c
/*C program that declares an array A and inputs n integer values in A.
Then the contents of array A is copied to another array B in reversed order.
Finally print the elements of array B*/
#include<stdio.h>
int main()
{
int n, reverse, i ;
int A[100], B[100] ;
printf("Input the size of array A: ") ;
View gulpfile.js
const T = require(./task’),
  gulp = require(‘gulp’);
// The transpiling Task
gulp.task(‘transpile’, ()=>
  gulp.src([./app.js’])
  .pipe(T.transpiler)
  .pipe(gulp.dest(./dist’)));
// styling Task
@Rafi993
Rafi993 / app.js
Created Dec 26, 2016
porting to expressjs from sailsjs
View app.js
let app = require('express')(),
connect = require('connect'),
bodyParser = require('body-parser'),
cors = require('cors'),
commandLineArgs = require('command-line-args');
const port = 1337;
const optionDefinitions = [
{ name:'port', alias:'p', type:Number, defaultOption: true ,defaultValue : 1337 }
]
@Rafi993
Rafi993 / package.json
Last active Dec 26, 2016
porting sailsjs application to expressjs
View package.json
{
"name": "sailslike",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node app.js",
"dev": "node ./node_modules/nodemon/bin/nodemon app.js",
"build": "node ./node_modules/webpack/bin/webpack app.js",
"prod": "node ./node_modules/ app.js && node ./n