Skip to content

Instantly share code, notes, and snippets.

@vejandla
vejandla / mousemove.ps1
Created December 23, 2022 03:53 — forked from MatthewSteeples/mousemove.ps1
Powershell Script to keep the mouse moving
Add-Type -AssemblyName System.Windows.Forms
while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X % 500) + 1
$y = ($pos.Y % 500) + 1
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 10
}
@vejandla
vejandla / How to create large sample files.md
Last active March 9, 2021 16:59
How to create large test files in no time

On Linux

dd is the command from Linux. To create 1 GB file go with dd if=/dev/zero of=testfile bs=1024 count=1024000

to create 100 MB try dd if=/dev/zero of=testfile bs=1024 count=102400

and for 10 MB use dd if=/dev/zero of=testfile bs=1024 count=10240

@vejandla
vejandla / fetch-all-branches-locally.md
Last active January 6, 2022 16:26
Checkout all branches locally

rip off from

(1) Inside git local repostitory, create a new sh file

touch getAllBranches.sh vi getAllBranches.sh

(2) Insert the below content to getAllBranches.sh file:

@vejandla
vejandla / simple-nodejs-iv-encrypt-decrypt.js
Created July 28, 2020 21:37 — forked from yoavniran/simple-nodejs-iv-encrypt-decrypt.js
nodejs crypto - simple encrypt & decrypt using IV (Initialization Vector)
"use strict";
var crypto = require("crypto");
var EncryptionHelper = (function () {
function getKeyAndIV(key, callback) {
crypto.pseudoRandomBytes(16, function (err, ivBuffer) {
var keyBuffer = (key instanceof Buffer) ? key : new Buffer(key) ;
@vejandla
vejandla / heroku.md
Last active February 24, 2020 20:30
generate ssh key

install heroku cli tools

cd "C:\Program Files\heroku\bin"

heroku login

heroku keys:add --select right ssh key (if there are multiples)

heroku create node-av-weather-application -- from the application folder.(name should be unique)

@vejandla
vejandla / ReorderableList.js
Created September 23, 2019 14:08 — forked from jlroettger/ReorderableList.js
React DND and Material UI - Reorderable List
import React, { Component } from 'react'
import { Link } from 'react-router'
// Drag and Drop
import { DragDropContext } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
// Material UI
import { List } from 'material-ui/List'
import Subheader from 'material-ui/Subheader'
class ReorderableList extends Component {
@vejandla
vejandla / powershell-aliases.ps1
Last active January 6, 2022 17:34
powershell aliases for git.
# add it in the default profile \Users\{username}\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# https://stackoverflow.com/a/41862274/2043920
# https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx
# Remove Defaults
rename-item alias:\gc gk -force
rename-item alias:\gcm gkm -force
rename-item alias:\gl gll -force
rename-item alias:\gsn gsnn -force
rename-item alias:\gm gmm -force
@vejandla
vejandla / npm-g-install.bat
Created July 2, 2019 13:04
Global npm packages.
# working with npm
npm install -g yarn
npm install -g npx
npm install -g np
npm install -g npm-name-cli
# debugging
npm install -g ndb
npm install -g node-inspector
@vejandla
vejandla / Choco-install.bat
Created May 14, 2019 13:18
choco Install new machine setup
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco feature enable -n allowGlobalConfirmation
choco install conemu /y
choco install 7zip.install /y
choco install git /y
choco install git.install /y
choco install nvm /y
choco install notepadplusplus /y
@vejandla
vejandla / MockFile.js
Created March 22, 2019 14:44 — forked from josephhanson/MockFile.js
Mock file for JavaScript based file upload - with basic test harness
// mock file
function MockFile() { };
MockFile.prototype.create = function (name, size, mimeType) {
name = name || "mock.txt";
size = size || 1024;
mimeType = mimeType || 'plain/txt';
function range(count) {
var output = "";