Skip to content

Instantly share code, notes, and snippets.

View bantya's full-sized avatar
🎯
Focussing

Rahul Thakare bantya

🎯
Focussing
  • http://127.0.0.1:4200
  • http://127.0.0.1:8080
  • 09:17 (UTC +05:30)
  • X @rkkth
View GitHub Profile
@bantya
bantya / deepseek-r1-0528-qwen3-8b.jinja
Created June 13, 2026 15:20
Default prompt templates
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='', is_first_sp=true, is_last_user=false) %}{%- for message in messages %}{%- if message['role'] == 'system' %}{%- if ns.is_first_sp %}{% set ns.system_prompt = ns.system_prompt + message['content'] %}{% set ns.is_first_sp = false %}{%- else %}{% set ns.system_prompt = ns.system_prompt + '
' + message['content'] %}{%- endif %}{%- endif %}{%- endfor %}{{ bos_token }}{{ ns.system_prompt }}{%- for message in messages %}{% set content = message['content'] %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{%- set ns.is_first = false -%}{%- set ns.is_last_user = true -%}{{'<|User|>' + content + '<|Assistant|>'}}{%- endif %}{%- if message['role'] == 'assistant' %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{% endif %}{%- if message['role'] == 'assistant' and message['tool_
@bantya
bantya / Floterminal.lua
Created January 6, 2025 05:08
Floating terminal in neovim
local state = {
floating = {
buf = -1,
win = -1,
},
}
local function create_floating_window(opts)
opts = opts or {}
local width = opts.width or math.floor(vim.o.columns * 0.8)
@bantya
bantya / object-watch.js
Created January 23, 2023 18:17 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@bantya
bantya / perlin-noise-classical.js
Created June 2, 2022 12:57 — forked from banksean/perlin-noise-classical.js
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@bantya
bantya / changelog.rb
Created January 2, 2022 11:13 — forked from ttscoff/changelog.rb
Generate release notes from git commit messages
#!/usr/bin/ruby
# A script to automate changelog generation from Git commit messages
#
# For use with a git-flow workflow, it will take changes from the last tagged release
# where commit messages contain NEW, FIXED, and IMPROVED keywords and sort and fromat
# them into a Markdown release note list.
#
# The script takes version information from the macOS command agvtool and bases
# the product name on the first matching Xcode Info.plist found
@bantya
bantya / barchart.rb
Created January 2, 2022 10:40 — forked from ttscoff/barchart.rb
Command line bar chart from JSON data (for GeekTool, et al)
#!/usr/bin/env ruby
# encoding: utf-8
# Brett Terpstra 2013, WTF license <http://www.wtfpl.net/txt/copying/>
# Outputs a vertical bar chart from date-based JSON data
# Requires the JSON rubygem: `[sudo] gem install json`
require 'date'
require 'open-uri'
require 'rubygems'
require 'json'
@bantya
bantya / hhrc.bat
Created June 2, 2021 14:07
A utility to create htmlhint rc file.
A utility to create htmlhint rc file
@bantya
bantya / af.bat
Created June 2, 2021 09:39
Create Angular modules and components.
:: af utility to create Angular modules and components. (af = angular file)
::
:: syntax: af [m|c] <name> <c:module name>
::
:: e.g: > af m utils
:: = create module named utils
:: > af c search utils
:: = create a search component in utils module
::
:: author: github.com/bantya
@bantya
bantya / angular-filename
Created May 29, 2021 13:44
VS Code Angular snippet filename transformation
{
// https://github.com/microsoft/vscode/issues/78110#issuecomment-524676592
"f-filename": {
"prefix": "f-filename",
"body": [
"${TM_FILENAME_BASE/((^[a-z])|[-.]([a-z]))/${2:/upcase}${3:/upcase}/g}"
],
"description": "filename"
}
}
@bantya
bantya / Randoms.cs
Created February 2, 2021 06:42
C# Random String Generator
// www.github.com/bantya
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Utils