Skip to content

Instantly share code, notes, and snippets.

@tkorakas
tkorakas / ChakraMonthYearCalendar.tsx
Created July 4, 2022 20:43
React component to select year/month using ChakraUI
import {
Input,
GridItem,
SimpleGrid,
Box,
Button,
Stack,
} from "@chakra-ui/react";
import { useReducer, useRef } from "react";
@tkorakas
tkorakas / remove-node-modules.js
Created August 31, 2018 12:14
Recursively remove node_modules folder from all your projects.
const { readdirSync, statSync, existsSync } = require('fs');
const { join } = require('path');
// npm init -y && npm install rimraf
const rimraf = require('rimraf');
if (process.argv.length == 2) throw Error('Required project folder');
const folder = process.argv[2];
const dirs = p => readdirSync(p).filter(f => statSync(join(p, f)).isDirectory());
const myDirs = dirs(folder);
myDirs.filter(proj => existsSync(`./${folder}/${proj}/node_modules`)).map((proj, index) => {
@tkorakas
tkorakas / Laravel JWT authentication
Created February 16, 2018 18:31
Lumen Laravel JWT authentication
<?php
namespace App\Providers;
use App\Models\User;
use Firebase\JWT\JWT;
use Illuminate\Support\ServiceProvider;
class AuthServiceProvider extends ServiceProvider {
#include<socialnerds.h>
main()
{
printf("Hello Nerds!!1");
}
{
"name": "Extension name",
"description": "Chrome extensions are awesome.",
"version": "1.0.0",
"manifest_version": 2,
"content_scripts": [
{
"matches": [
"https://www.google.com/*",
"*://*/*"
@tkorakas
tkorakas / Gulpfile-for-sass.js
Created February 26, 2017 19:31
Gulpfile for Sass compilation. Sourcemaps included.
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
// Compile sass to css for dev.
gulp.task('sass:dev', function() {
return gulp.src('./sass/*.scss')
// Initializes sourcemaps.
.pipe(sourcemaps.init())
@tkorakas
tkorakas / gulpfile.js
Last active January 30, 2018 21:32
Simple gulp task to concatenate markdown to pdf from multiple files to one.
/**
* @description Multi markdown files to pdf.
* @author Thanos Korakas <[email protected]>
*/
var gulp = require('gulp');
var markdownpdf = require('gulp-markdown-pdf');
var concat = require('gulp-concat');
gulp.task('default', function () {
return gulp.src('path/*.md')