Skip to content

Instantly share code, notes, and snippets.

Avatar
😈
Planning to come up with a plan to plan all other plans

Roshan Gautam roshangautam

😈
Planning to come up with a plan to plan all other plans
View GitHub Profile
@roshangautam
roshangautam / textfield.js
Last active Feb 22, 2018
Override Default textfield.js to remove is-invalid by default for required textfields.
View textfield.js
(function() {
'use strict';
MaterialTextfield = window['MaterialTextfield'];
/**
* Handle lost focus.
*
* @private
*/
View gist:d84cc2e497b102bfc4d4
DROP FUNCTION IF EXISTS UPDATE_TEAM_GUID;
DELIMITER |
CREATE FUNCTION UPDATE_TEAM_GUID(old_slug TEXT)
RETURNS TEXT
BEGIN
DECLARE slug_maxlength INT DEFAULT 64;
DECLARE cut_length INT DEFAULT 4;
DECLARE new_slug TEXT;
DECLARE count_duplicate INT;
DECLARE slugcount INT;
View gist:50cae483d0e77f2f227e
DROP FUNCTION IF EXISTS UPDATE_MEMBER_GUID;
DELIMITER |
CREATE FUNCTION UPDATE_MEMBER_GUID(old_slug TEXT)
RETURNS TEXT
BEGIN
DECLARE slug_maxlength INT DEFAULT 64;
DECLARE cut_length INT DEFAULT 4;
DECLARE new_slug TEXT;
DECLARE count_duplicate INT;
DECLARE slugcount INT;
View gist:2ccda571476e70b48328
DROP FUNCTION IF EXISTS UPDATE_SLUG;
DELIMITER |
CREATE FUNCTION UPDATE_SLUG(old_slug TEXT)
RETURNS TEXT
BEGIN
DECLARE slug_maxlength INT DEFAULT 64;
DECLARE cut_length INT DEFAULT 4;
DECLARE new_slug TEXT;
DECLARE count_duplicate INT;
DECLARE slugcount INT;
View gist:33fd915074b27647a606
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
@roshangautam
roshangautam / gist:12d7d05ba400ff7120e8
Last active Aug 29, 2015
search-and-replace-in-files.sh
View gist:12d7d05ba400ff7120e8
#!/bin/bash
if [[ $# -ne 1 ]]
then
echo "Usage $0 path/to/your/directory" # path parameter missing
exit 2
fi
directory=$1
@roshangautam
roshangautam / gist:299519189954e6143cc2
Created Mar 25, 2015
git-truncate-commit-history.sh
View gist:299519189954e6143cc2
#!/bin/bash
if [[ $# -ne 3 ]]
then
echo "Usage $0 <repository path> <commit hash> <branch name>" # missing parameters
exit 2
fi
cd $1
git checkout --orphan temp $2
git commit -m "Initial Commit"
@roshangautam
roshangautam / gist:2f67eebcca5bfcf42295
Last active Aug 29, 2015
git-rewrite-commit-history.sh
View gist:2f67eebcca5bfcf42295
#!/bin/sh
if [[ $# -ne 4 ]]
then
echo "Usage $0 <repository path> <Old Committer Email> <New Committer Name> <New Committer Email>" # missing parameters
exit 2
fi
cd $1
View macs-on-active-directory.md

Binding and Unbinding to Active Directory from Mac OS via Command Line

  • Open the Terminal Application
  • Type in sudo -i and type in your Mac Administrator account password. sudo gives you root level or administrator level privileges.

To View current Active Directory Settings

dsconfigad -show

To Unbind a Computer from an Active Directory Domain

View free-space-on-boot-disk.md

Free disk space when /boot is full (Ubuntu)

TL;DR

dpkg -l linux-image*
uname -r
sudo apt-get remove linux-image-2.6.32-{21,37,38,39,40,41,42,43,44}-server
sudo apt-get autoremove
You can’t perform that action at this time.