Skip to content

Instantly share code, notes, and snippets.

@wbthomason
wbthomason / help.vim
Last active December 26, 2023 01:41
Neovim: Open help in a floating window
scriptencoding utf-8
" This function originates from https://www.reddit.com/r/neovim/comments/eq1xpt/how_open_help_in_floating_windows/; it isn't mine
function! CreateCenteredFloatingWindow() abort
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
@HamedMasafi
HamedMasafi / main.cpp
Created January 7, 2020 08:32
QCalendar and jalali calendar in Qt 5.14
#include <QCoreApplication>
#include <QCalendar>
#include <QDate>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QCalendar cal(QLatin1String("jalali"));
@qzm
qzm / aria2.conf
Last active April 27, 2024 04:59
Best aria2 Config
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5
-nostdlibinc
-I/home/uchan/osbook/devenv/x86_64-elf/include
-I/home/uchan/osbook/devenv/x86_64-elf/include/c++/v1
-I.
-D__ELF__
-D_LIBCPP_HAS_NO_THREADS
-O2
-Wall
-g
--target=x86_64-elf
{ ...}:
{
#...
nixpkgs.overlays = [
(import ./overlay.nix)
];
#...
export TERM=xterm-color
# set up android home and build the app
export ANDROID_HOME=/mnt/storage/gits/Android/ && gradle-3.4.1 build && \
# sign the apk using the keystore "my.keystore"
/mnt/storage/AndroidSDK/build-tools/25.0.2/apksigner sign --ks my.keystore app/build/outputs/apk/app-release-unsigned.apk && \
# uninstall existing app
# adb uninstall com.serwylo.lexica && \
# install the new version
# adb install app/build/outputs/apk/app-release-unsigned.apk && \
echo "All done. Nothing left to do baby!"
@nazmul629
nazmul629 / readme.md
Last active December 22, 2023 14:00
Windows 10 activate code

Windows 10 Active process

  • Step 1. Fast create a .txt file.
  • step 2. Then Copy this .text and past on the .txt file .
@echo off
title Windows 10 ALL version activator&cls&echo ************************************ 
&echo Copyright: Youtube: ithelpbd.com &echo.&echo Supported products:&echo - Windows 10 Home&echo - Windows 10 Professional&echo - Windows 10 Enterprise, Enterprise LTSB&echo - Windows 10 Education&echo.&echo.&echo ************************************ &echo Windows 10 activation...
cscript //nologo c:\windows\system32\slmgr.vbs /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 >nul
cscript //nologo c:\windows\system32\slmgr.vbs /ipk 3KHY7-WNT83-DGQKR-F7HPR-844BM >nul
@sgon00
sgon00 / dart.vim
Created December 4, 2018 09:50
Put it at `~/.vim/after/syntax/dart.vim` to add/override anything in `~/.vim/bundle/dart-vim-plugin/syntax/dart.vim`.
syn match dartFunction "\zs\(\k\w*\)*\s*\ze("
hi! link dartFunction Function
syn match myCamelCase '\v(<_*\u\i*>)+'
hi! link myCamelCase Type
syntax keyword flutterConstant immutable kAlwaysCompleteAnimation kAlwaysDismissedAnimation
\ kBackMouseButton kBottomNavigationBarHeight kDoubleTapMinTime kDoubleTapSlop kDoubleTapTimeout
\ kDoubleTapTouchSlop kElevationToShadow kFloatingActionButtonMargin kFloatingActionButtonSegue
\ kFloatingActionButtonTurnInterval kForwardMouseButton kHoverTapSlop kHoverTapTimeout kJumpTapTimeout
@Softsapiens
Softsapiens / builder.sh
Created July 27, 2018 09:17 — forked from jefdaj/builder.sh
Draft nix expression to wrap debian packages.
source $stdenv/setup
PATH=$dpkg/bin:$PATH
dpkg -x $src unpacked
cp -r unpacked/* $out/
@timabell
timabell / assoc.ps1
Last active December 6, 2022 15:22
set windows file associations
# https://gist.github.com/timabell/bc90e0808ec1cda173ca09225a16e194
# MIT license
$exts=@(
"csv",
"csproj",
"json",
"log",
"md",
"patch",
"sql",