Skip to content

Instantly share code, notes, and snippets.

View privatmamtora's full-sized avatar

privatmamtora

View GitHub Profile
@privatmamtora
privatmamtora / MoveUp.vbs
Created February 4, 2017 04:01
Script that will mode all files to the root of the directory provided (Flatten deep folders)
if WScript.Arguments.Count = 0 then
WScript.Echo "Missing parameters"
end if
Sub Pause(strPause)
WScript.Echo (strPause)
End Sub
Function MoveOrCopyFile(Source, Destination, FileName)
If objFSO.FileExists(Destination & "\" & FileName) Then
@privatmamtora
privatmamtora / tota11y.min.user.js
Created October 9, 2015 18:47
Using Khan/tota11y with greasemonkey
/*!
* tota11y v0.1.2
* http://khan.github.io/tota11y
*
* Includes Accessibility Developer Tools
* http://github.com/GoogleChrome/accessibility-developer-tools
*
* Copyright (c) 2015 Khan Academy
* Released under the MIT license
* http://github.com/Khan/tota11y/blob/master/LICENSE.txt
@privatmamtora
privatmamtora / updateRuby
Last active January 12, 2022 19:49
Use rbenv to automate updating to latest ruby version
#!/bin/bash
# Name: updateRuby
# Purpose: Upgrade ruby
# Author: Privat Krish Mamtora Atmaram
# -----------------------------------------------------------------------------------
usage ()
{
cat <<EOF
@privatmamtora
privatmamtora / updatePerl
Last active March 23, 2016 15:47
A script to update perl using perlbrew (perlbrew upgrade-perl, doesn't seem to work)
#!/bin/bash
# Name: updateperl
# Purpose: Upgrade perl
# Author: Privat Krish Mamtora Atmaram
# -----------------------------------------------------------------------------------
usage ()
{
cat <<EOF
@privatmamtora
privatmamtora / .updatePackages
Last active January 12, 2022 19:50
Command to update package managers
alias update='sudo softwareupdate -i -a; brew update; brew upgrade --all; brew cleanup; brew cask cleanup; brew prune; npm update -g npm; npm update -g; sudo gem update --system; gem update; gem cleanup; pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U; sudo composer self-update; composer global update; . updatePerl; cpan -u; meteor update;'
@privatmamtora
privatmamtora / concatfile.py
Created August 3, 2015 18:10
Will download and concatenate files
#!/usr/bin/env python
"""Downloads and concatenates a set list of
block-list files for use with Transmission"""
#Copyright 2013, Adam David Cox
#adam.david.cox@gmail.com
#Thanks for PabloG for downloadURL()
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
@privatmamtora
privatmamtora / UserModelFactory.php
Created July 3, 2015 10:54
User Model Factory for seeding with Faker (created, updated, deleted timestamps)
<?php
$factory->define(\App\Models\User::class, function ($faker) {
$created = $faker->dateTimeBetween($startDate = '-30 years', $endDate = 'now');
// Have 60% have updated records
$updated = $faker->optional($weight = 0.6)->dateTimeBetween($startDate = $created);
if(empty($updated)) {
// The rest 40% will have same date as created (unchanged record)
$updated = $created;
@privatmamtora
privatmamtora / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@privatmamtora
privatmamtora / post_virtualhost_2.conf
Last active August 29, 2015 14:21
Apache base post configuration
# Apache Server Configs v2.14.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# ######################################################################
@privatmamtora
privatmamtora / MoveUp.cmd
Last active August 29, 2015 14:20
Moves all files to root. Will not move duplicates. Removes leftover empty folders.
:: Name: MoveUp.cmd
:: Purpose: Moves all files to root. Will not move duplicates. Removes leftover empty folders.
:: Author: privat.mamtora@gmail.com
:: Version: 1.1
:: Revision: May 2015 - initial version
:: Revision: May 2015 - Fixed issue 1# directory special character issues with ROBOCOPY
:: Revision: May 2015 - Fixed issue 2# Directory with exclamation marks
:: Revision: Jun 2015 - Fixed filenames with &
:: Revision: Jun 2015 - Migrate to use "Send To" menu, allows for multiple select by single process