Skip to content

Instantly share code, notes, and snippets.

View jamilxt's full-sized avatar
✔️

jamilxt jamilxt

✔️
View GitHub Profile
@Showrin
Showrin / MetaWrapper.jsx
Last active April 19, 2023 05:17
A component that implements basic SEO to any NextJS app
import Head from 'next/head';
import PropTypes from 'prop-types';
const MetaWrapper = (props) => {
const {
title,
description,
type,
imageUrl,
contentUrl,
@Ishmam156
Ishmam156 / banglaspeakChatGPT.py
Last active March 16, 2023 06:33
Python script based on gradio library to create a quick website showcasing the ability to use audio to interact with ChatGPT
import config
from google.cloud import speech, texttospeech
import gradio as gr
import io
import openai
import os
from playsound import playsound
openai.api_key = config.OPENAI_API_KEY ## API Key from ChatGPT stored in a config.py file in same directory
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "./cloud_creds.json" ## Path to service account credentials JSON from Google Cloud Platform
@donnfelker
donnfelker / .zshrc
Last active July 1, 2022 13:14
Vanilla ZSH
# Hat tip to Kaushik Gopal for some of this
# make zsh tab completion fix capitalization errors for directories and files
# i don't know if this is required anymore
# autoload -Uz compinit && compinit
# 0 -- vanilla completion (abc => abc)
# 1 -- smart case completion (abc => Abc)
# 2 -- word flex completion (abc => A-big-Car)
# 3 -- full flex completion (abc => ABraCadabra)
@iolufemi
iolufemi / Dockerfile
Created November 5, 2021 22:23
Add Pentaho to Apache Fineract in a Docker Environment
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@Sadmansamee
Sadmansamee / flutter_starter.md
Last active February 9, 2023 03:44
Flutter Starter Kits
@mainul35-bs23
mainul35-bs23 / MySQL user grants and Password policy reset.md
Last active September 3, 2020 18:58
MySQL user grants and Password policy reset

Background story

It is a common scenario that we often forget out database password. When we try to log in to our mysql DB, we face the following error message. If we use a password:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

If we don't use a password:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
@thomasdarimont
thomasdarimont / App.java
Created November 6, 2018 19:09
Simple Spring Boot App protected by Keycloak with initial roles from Keycloak and additional hierarchical app Internal roles. Supports fine grained permission checks, where the permissions are derived from roles.
package demo;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
@DevoKun
DevoKun / kafka.md
Created July 13, 2018 02:52
How to operate Kafka, mostly using Docker

Kafka Distributed Streaming Platform

Publish and Subscribe / Process / Store

Start Kafka

  • Kafka uses ZooKeeper as a distributed backend.

Start Zookeeper

@ekswai
ekswai / UserRestControllerTest.java
Last active October 23, 2022 13:39
spring oauth2 rest template with client credentials grant sample
import org.junit.Test;
import org.junit.runner.RunWith;
import org.master.Application;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails;