Skip to content

Instantly share code, notes, and snippets.

View tomavic's full-sized avatar
I work to clear off my pending work

Hatem tomavic

I work to clear off my pending work
View GitHub Profile
@diegotauchert
diegotauchert / gist:82635d52ae697a64756650554db3fff7
Created February 8, 2022 02:02
Strip Property function, hackerrank Javascript code chalenge
function stripProperty(obj, prop) {
const newObj = Object.keys(obj).filter(el => el !== prop)
const values = newObj.map(el => [el, obj[el]])
return Object.fromEntries(values)
}
@popescuaaa
popescuaaa / useAxios.ts
Created August 16, 2021 13:12
react typescript axios hook
/* eslint-disable react-hooks/exhaustive-deps */
import { useEffect, useState } from "react";
import axios, { Method } from "axios";
/**
* https://github.com/ali-master/react-typescript-hooks-sample
*/
const useFetch = (
url: string,
method: Method,
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 28, 2025 14:26
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@simpledescifrador
simpledescifrador / customcss.css
Last active May 3, 2021 11:39
VSCode Custom CSS
/* Add the subtle gradient to the editor background */
.monaco-editor {
background-color: transparent !important;
background-image: linear-gradient(to bottom, #2a2139 75%, #34294f);
background-size: auto 100vh;
background-position: top;
background-repeat: no-repeat;
}
.monaco-workbench {
@KartoffelToby
KartoffelToby / angular.json
Created August 1, 2019 09:19
Angular with Brotli
...
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./extend.webpack.config.js"
},
...
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active April 18, 2025 13:45
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@manekinekko
manekinekko / spaceship-prompt__sections__angular.zsh
Last active February 14, 2025 22:34
Customize your Oh My Zsh SpaceShip theme with Angular and AngularCLI prompt (https://github.com/denysdovhan/spaceship-prompt)
SPACESHIP_ANGULAR_SHOW="${SPACESHIP_ANGULAR_SHOW:=true}"
SPACESHIP_ANGULAR_PREFIX="${SPACESHIP_ANGULAR_PREFIX:="and "}"
SPACESHIP_ANGULAR_SUFFIX="${SPACESHIP_ANGULAR_SUFFIX:="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"}"
SPACESHIP_ANGULAR_SYMBOL="${SPACESHIP_ANGULAR_SYMBOL:="🅰️ "}"
SPACESHIP_ANGULAR_DEFAULT_VERSION="${SPACESHIP_ANGULAR_DEFAULT_VERSION:=""}"
SPACESHIP_ANGULAR_COLOR="${SPACESHIP_ANGULAR_COLOR:="red"}"
_is_angular_project() {
node -p "r=require('./package.json'); r.devDependencies['$1'] || r.dependencies['$1']" 2>/dev/null
}
@sators
sators / arrayToCsv.js
Last active January 3, 2023 18:10
Convert Array of Objects to CSV with Javascript
/**
* Take an array of objects of similar structure and convert it to a CSV.
* @source https://halistechnology.com/2015/05/28/use-javascript-to-export-your-data-as-csv/
* @modifiedBy sators
* @param {Array} options.data Array of data
* @param {String} options.columnDelimiter Column separator, defaults to ","
* @param {String} options.lineDelimiter Line break, defaults to "\n"
* @return {String} CSV
*/
export default ({data = null, columnDelimiter = ",", lineDelimiter = "\n"}) => {
@JoeMeeks
JoeMeeks / InputMask.html
Last active October 25, 2020 13:44
Custom Ionic 2 & 3 Input Mask Directive
<ion-input type="tel" pattern="\d*" placeholder="(xxx) xxx-xxxx" mask="(***) ***-****" [(ngModel)]="phone" name="phone"></ion-input>
<ion-input type="tel" pattern="\d*" placeholder="xxx-xx-xxxx" mask="***-**-****" [(ngModel)]="ssn" name="ssn"></ion-input>
@mikebridge
mikebridge / exampleComponent.tsx
Created April 28, 2017 20:33
An example react component in TypeScript
import * as React from "react";
import * as PropTypes from "prop-types";
interface IExampleComponentProps {
text?: string;
onCounterIncrease: (count: number) => void;
}
interface IExampleComponentState {
clicks: number;