Skip to content

Instantly share code, notes, and snippets.

View dilawar's full-sized avatar
🐕
w**king

Dilawar Singh dilawar

🐕
w**king
View GitHub Profile
@dilawar
dilawar / notion2blog.js
Last active September 6, 2022 14:01 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "dilawars.me"
const START_PAGE = "https://www.notion.so/dilawars/Dilawar-Singh-fbc9f970d6da463aa8b2a63ea42e8987"
const DISQUS_SHORTNAME = "dilawars-me"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
cube([200, 100, 2]);
translate([5,60, 3])
linear_extrude(2)
text("Congrats!", 30, "Arial");
translate([5,35,3])
linear_extrude(1.5)
text("Dr. Motu Mc Chotu!", 16, "Arial");
translate([5,15,3])
@dilawar
dilawar / README.md
Last active April 29, 2022 10:11
Docker compose file for RustDesk

Replace rustdesk.subcom.tech with your domain name or ip address.

At the time of writing, only demo option works for -m option. -m takes registered email but this feature was not implemented at the time of writing this gist.

I think RustDesk is planning for paid email subscription later.

@dilawar
dilawar / .clang-format
Created December 16, 2021 07:48
Official .clang-format of SubconsciousCompute
---
BasedOnStyle: Webkit
SortIncludes: false
ColumnLimit: 80
AlignTrailingComments: true
AlignConsecutiveMacros: true
AllowShortFunctionsOnASingleLine: false
...
@dilawar
dilawar / docker-compose-backup.sh
Created July 4, 2021 07:06 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@dilawar
dilawar / README.md
Created August 5, 2018 06:00 — forked from andyshinn/README.md
pbcopy over SSH

Install

  • Add pbcopy.plist to your ~/Library/LaunchAgents/ folder.
  • Launch the listener with launchctl load ~/Library/LaunchAgents/pbcopy.plist.
  • Add RemoteForward 2224 127.0.0.1:2224 in your ~/.ssh/config file under your Host * or specific hosts sections.
  • Add [ -n "$SSH_CLIENT" ] && alias pbcopy="nc localhost 2224" to your remote ~/.bash_profile or other shell profile.
  • Enjoy pbcopy remotely!
@dilawar
dilawar / pgfplots.md
Last active July 31, 2018 06:07
My PGFPLOTS notes

Labels

  1. Attach label on axis by relative position \node[yshift=3mm0] at (rel axis cs:0,1) {\bf A};. Always put this line outsize axis environment. Otherwise, it will be clipped.

\addlegendentry inside \foreach loop

\foreach \x in {1,2,3}
{
@dilawar
dilawar / compress.py
Last active September 26, 2017 12:46
Compress/decompress a file using Huffman code
#!/usr/bin/env python
from __future__ import print_function, division
__author__ = "Dilawar Singh"
__copyright__ = "Copyright 2017-, Dilawar Singh"
__version__ = "1.0.0"
__maintainer__ = "Dilawar Singh"
__email__ = "dilawars@ncbs.res.in"
@dilawar
dilawar / Packaging_Example.sh
Created November 4, 2015 19:47 — forked from asmaloney/Packaging_Example.sh
This is an example of script to package up and create a DMG for a Mac OS X app. Details may be found here: http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
#!/bin/bash
# by Andy Maloney
# http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
# make sure we are in the correct dir when we double-click a .command file
dir=${0%/*}
if [ -d "$dir" ]; then
cd "$dir"
fi
#!/bin/bash
SEPARATOR='_'
find . -maxdepth 1 -type f -name "*" -print0 | while read -d $'\0' file
do
IFS=$SEPARATOR read -a _file <<< "$file"
STUDENTDIR="${_file[0]}"
STUDENTDIR="${STUDENTDIR// /_}"
mkdir -p $STUDENTDIR
echo "Moving $file to $STUDENTDIR"
mv "$file" $STUDENTDIR