Skip to content

Instantly share code, notes, and snippets.

View Rafi993's full-sized avatar
🤖
Alive!!!

Rafi Rafi993

🤖
Alive!!!
View GitHub Profile
@Rafi993
Rafi993 / package.json
Last active December 26, 2016 06:39
porting sailsjs application to expressjs
{
"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
@Rafi993
Rafi993 / app.js
Created December 26, 2016 06:40
porting to expressjs from sailsjs
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 }
]
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 / JJd8-0.c
Created July 1, 2017 04:16
null created by Rafi993 - https://repl.it/JJd8/0
/*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: ") ;
@Rafi993
Rafi993 / trained model
Created April 24, 2018 07:48
trained model
{
"modelTopology": {
"backend": "tensorflow",
"training_config": {
"loss_weights": null,
"loss": "categorical_crossentropy",
"metrics": ["accuracy"],
"optimizer_config": {
"config": {
"rho": 0.8999999761581421,
@Rafi993
Rafi993 / vscodeSnippetGenerator.js
Created January 9, 2020 09:47
vscode snippet generator from markdown
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 = {};
@Rafi993
Rafi993 / application_controller.rb
Created November 12, 2020 02:23
ApplicationController
class ApplicationController < ActionController::Base
end
@Rafi993
Rafi993 / useContextMenu.js
Created November 19, 2020 02:17
useContextMenu
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();