Skip to content

Instantly share code, notes, and snippets.

View ggluta's full-sized avatar
👽
Let's jam!

George Gabriel Luță ggluta

👽
Let's jam!
View GitHub Profile
@moritzsalla
moritzsalla / test.yml
Created August 2, 2023 16:01
Github action - Unit test
name: Tests
on:
pull_request:
jobs:
Unit:
runs-on: ubuntu-latest
strategy:
@andy3520
andy3520 / color.js
Last active March 3, 2023 16:09
Tailwind UI default config and color, form
module.exports = {
transparent: 'transparent',
white: '#ffffff',
black: '#000000',
gray: {
'50': '#f9fafb',
'100': '#f4f5f7',
'200': '#e5e7eb',
'300': '#d2d6dc',
'400': '#9fa6b2',
@cvan
cvan / tailwind.config.js
Last active July 5, 2024 10:46
tailwind CSS breakpoints (including iPhone 11 Pro Max)
// References used:
// - https://yesviz.com/devices.php
// - https://ricostacruz.com/til/css-media-query-breakpoints
// - https://tailwindcss.com/docs/responsive-design/#customizing-breakpoints
screens: {
'2xs': { min: '300px' },
xs: { max: '575px' }, // Mobile (iPhone 3 - iPhone XS Max).
sm: { min: '576px', max: '897px' }, // Mobile (matches max: iPhone 11 Pro Max landscape @ 896px).
md: { min: '898px', max: '1199px' }, // Tablet (matches max: iPad Pro @ 1112px).
lg: { min: '1200px' }, // Desktop smallest.
@edmondburnett
edmondburnett / gist:38ed3451de659dc43fa3f24befc0073b
Last active July 12, 2023 14:23
Axios Interceptor to delay and retry original request for certain status code (polling)
import axios from 'axios';
const instance = axios.create({
baseURL: 'http://localhost:5000'
});
const sleepRequest = (milliseconds, originalRequest) => {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(instance(originalRequest)), milliseconds);
});
@javilobo8
javilobo8 / download-file.js
Last active July 27, 2024 07:41
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@nielsutrecht
nielsutrecht / RsaExample.java
Created December 28, 2016 14:13
Example of RSA generation, sign, verify, encryption, decryption and keystores in Java
import javax.crypto.Cipher;
import java.io.InputStream;
import java.security.*;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class RsaExample {
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
@chranderson
chranderson / nvmCommands.js
Last active July 26, 2024 20:22
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 27, 2024 13:28
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k