Skip to content

Instantly share code, notes, and snippets.

View hmble's full-sized avatar
🙈
Learning

Samyak Bakliwal hmble

🙈
Learning
View GitHub Profile
@hmble
hmble / gooey.txt
Created November 3, 2019 11:30
Gooey effect gist.
// From article (CSS-Tricks)[https://css-tricks.com/gooey-effect/]
// Do follow this article by Lucas Bebber to get good understanding about SVG Filters such as blur
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9" result="goo" />
<feComposite in="SourceGraphic" in2="goo" operator="atop"/>
</filter>
@hmble
hmble / commands.txt
Last active February 12, 2020 10:23
Upgrading nodejs and npm on arch linux.
sudo pacman -S npm --overwrite="*"
sudo pacman -S nodejs --overwrite="*"
// Use this two commands before doing
// sudo pacman -Syu becuase npm blocks package upgrading by returning error like node_modules/...
//files already present
@hmble
hmble / install.sh
Created February 26, 2020 07:31
Dotfiles install script
# This script is copied from author durdn
# His bitbucket repo link : https://bitbucket.org/durdn
# It was a part of article
# https://www.atlassian.com/git/tutorials/dotfiles
git clone --bare git@bitbucket.org:durdn/cfg.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup
@hmble
hmble / changebr.rs
Last active March 16, 2020 06:48
run this file with sudo
use std::env;
use std::fs;
fn main() {
let max_brightness: i32 = 800;
let args: Vec<String> = env::args().collect();
let path = "/sys/class/backlight/intel_backlight/brightness";
//let content = &args[1].as_bytes();
let mut str = "down";
if args.len() == 2 {
str = &args[1].trim();
@hmble
hmble / gulpfile.js
Last active November 10, 2020 15:27
Gulpfile setup for v4
const { src, watch, dest, parallel } = require("gulp");
const sass = require("gulp-sass");
const prefix = require("gulp-autoprefixer");
const cssmin = require("gulp-cssnano");
const rename = require("gulp-rename");
const browsersync = require("browser-sync").create();
const reload = browsersync.reload;
// pass arguments with --option value
// eg. gulp watch --path index.html
@hmble
hmble / mirrorupgrade.hook
Created August 9, 2020 08:53
pacman refelector hook to update mirrorlist
[Trigger]
Operation = Upgrade
Type = Package
Target = pacman-mirrorlist
[Action]
Description = Updating pacman-mirrolist with reflector and removing pacnew
When = PostTransaction
Depends = reflector
Exec = /bin/sh -c "reflector --latest 100 --age 24 --sort rate --save /etc/pacman.d/mirrorlist; rm -rf /etc/pacman.d/mirrorlist.pacnew"
@hmble
hmble / save.js
Created October 23, 2020 06:16
A simple script to download all saved reddit posts.
"use strict";
const got = require("got");
const snoowrap = require("snoowrap");
const cheerio = require("cheerio");
const fs = require("fs");
const { createWriteStream } = fs;
const path = require("path");
const CLIENT_ID = "CLIENT_ID";
const CLIENT_SECRET = "CLIENT_SECRET";
@hmble
hmble / extract.js
Created October 31, 2020 15:16
A simple nodejs script to extract bookmark url from exported firefox bookmarks json
const bookmarks = require("./bookmarks-2020-10-31.json");
const fs = require("fs");
let array = [];
// https://stackoverflow.com/a/15855457
function validateUrl(value) {
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
value
);
@hmble
hmble / vim-settings.json
Created December 30, 2020 05:15
vscode-vim settings
"vim.easymotion": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
"before": ["j", "k"],
"after": ["<Esc>"]
}
@hmble
hmble / get_all_tables.sql
Created January 14, 2021 12:54
Get all table names in MSSQL
SELECT TABLE_NAME
FROM <DB_NAME>.INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'