Posts

Create a folder in the project root directory named " z_css " for tailwind Open terminal and go inside " z_css " type " npm init -y " and enter run npm install tailwindcss @tailwindcss/cli create file " input.css " inside z_css folder and paste the code @import "tailwindcss" source (none); @source "../templates/**/*.html" ; @source "../**/templates/**/*.html" ; Inside package.json paste the following code "dev" : "npx @tailwindcss/cli -i ./src/input.css -o ../static/css/tailwind.output.css --watch" , "build" : "npx @tailwindcss/cli -i ./src/input.css -o ../static/css/tailwind.output.css --minify" Now at last add below code to settings.py in django below STATIC_URL = 'static/' STATICFILES_DIRS = [             os . path . join ( BASE_DIR , 'static' ),         ] STATIC = '/static/' STATIC_ROOT = os . path . join ( BASE_DIR , 'staticfiles...
 Convert normal video file to hls streaming ready files: for only one quality: ffmpeg -i my_video.mp4 -c:a copy -c:v copy -hls_time 6 -hls_list_size 0 -hls_segment_filename "segment%03d.ts" playlist.m3u8 for multiple quality like 360p, 720p, 1080p: ffmpeg -i input_video.mp4 -filter_complex "[0:v]split=3[v1][v2][v3];[v1]scale=w=1920:h=1080[v1out];[v2]scale=w=1280:h=720[v2out];[v3]scale=w=854:h=480[v3out]" -map "[v1out]" -c:v:0 libx264 -b:v:0 5000k -maxrate:v:0 5350k -bufsize:v:0 7500k -map "[v2out]" -c:v:1 libx264 -b:v:1 2800k -maxrate:v:1 2996k -bufsize:v:1 4200k -map "[v3out]" -c:v:2 libx264 -b:v:2 1400k -maxrate:v:2 1498k -bufsize:v:2 2100k -map a:0 -c:a:0 aac -b:a:0 192k -ac 2 -map a:0 -c:a:1 aac -b:a:1 128k -ac 2 -map a:0 -c:a:2 aac -b:a:2 96k -ac 2 -f hls -hls_time 10 -hls_playlist_type vod -hls_flags independent_segments -hls_segment_type mpegts -hls_segment_filename stream_%v/data%03d.ts -master_pl_name master.m3u8 -var_stream_ma...
 Removing particular bug commit from git: >> git log --oneline >> git reset --hard <commitid> >> git push -f Removing particular file like big file more than 100 mb(not uploadable on github) removing from the previous commit: to remove the large file git rm --cached <filename> Then, to edit the commit git commit --amend -C HEAD # very important Then you can push your amended commit with git push
Image
 class ChatConsumer(AsyncWebsocketConsumer): async def connect(self): query_string_bytes = self.scope.get('query_string', b'') # 1. Get the raw query string from the scope query_string_str = query_string_bytes.decode('utf-8') # 2. Decode it from bytes to string (UTF-8 is a common encoding) query_params = parse_qs(query_string_str) # 3. Parse the query string into a dictionary token_list = query_params.get('token', []) # 4. Extract the token value token = token_list[0] if token_list else None user = await get_user_from_token(token) self.room_name = self.scope[ 'url_route' ][ 'kwargs' ][ 'room_name' ] self.room_group_name = f'chat_ {self.room_name} ' # Authenticate user if isinstance (user, AnonymousUser): await self.close() else : self.user = user # Join room group await self.channel_layer.group_add( self.room_group_name, self.channel_name ...
 I have a game Idea okay you have to remember that when I ask you some days before or someone before about the game Idea then you give me give me this idea okay ChatGPT said: Sure, I can remember your game idea so you can refer back to it later. Please go ahead and share your game idea! 4o You said: Okay Idea stars with like there is a game where the game is about finding a perfect soul partner where we can it is a unity based game or any other engine will be OK and there is like a virtual old where we can go and ask people to connect like in a game and if the person asked agree then the conversation starts with voice call voice conversation and we can send the different kind of gift to the other people in the game and we I need to make a game currency where I can buy different kind of gifts and send to the others like this the game runs and can you give me the idea and different functionalities I can to the game to make the games more interesting and fun to play and connect with t...