Skip to content

Instantly share code, notes, and snippets.

@sajadtorkamani
sajadtorkamani / test.html
Created August 27, 2024 16:56
Hello World Html
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@sajadtorkamani
sajadtorkamani / test.md
Created August 27, 2024 16:55
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@sajadtorkamani
sajadtorkamani / .prettierrc
Created May 12, 2022 13:10
Prettier config file
{
"semi": false,
"singleQuote": true
}
@sajadtorkamani
sajadtorkamani / solution.js
Created February 6, 2020 16:20
Find min example
// The counter implementation to the weird function!
const solution = n => {
let result = [];
for (let num = 1; num <= n; num++) {
result.push(num);
}
return result;
};
@sajadtorkamani
sajadtorkamani / five-digit.js
Created February 6, 2020 16:19
Insert 5 digit to obtain maximum value
const solution = num => {
const isNegativeNum = num < 0;
const numStr = Math.abs(num).toString();
const permutations = [];
for (let i = 0; i <= numStr.length; i++) {
const permutation = Number(numStr.substr(0, i) + '5' + numStr.substr(i));
permutations.push(permutation);
}
@sajadtorkamani
sajadtorkamani / gulpfile.js
Created November 27, 2019 19:40
Browsersync
const { watch } = require('gulp');
const browserSync = require('browser-sync').create();
const reloadBrowser = cb => {
browserSync.reload();
cb();
};
exports.default = function() {
browserSync.init({ proxy: 'http://localhost:3000' });
@sajadtorkamani
sajadtorkamani / gulpfile.js
Created November 27, 2019 19:21
gulp-livereload
const { watch } = require('gulp');
const livereload = require('gulp-livereload');
const watchPaths = ['app/assets', 'app/views'];
const reloadBrowser = cb => {
console.log('Reloading browser...');
livereload.reload();
cb();
};
import { createGlobalStyle } from 'styled-components';
import typography from './typography';
const GlobalStyle = createGlobalStyle`
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
@sajadtorkamani
sajadtorkamani / gist1.jsx
Last active November 8, 2019 22:21
React gists
const name: string = 'hello';
type Props = {
name: string;
}
#!/usr/bin/env bash
# Copy type definitions
printf "%s\n\nexport = Schemas;" "$(cat src/types/schema.d.ts)" > packages/types/index.d.ts
# Bump version and publish
cd packages/types && \
npm version patch && \
npm publish