Skip to content

Instantly share code, notes, and snippets.

@ajitStephen
Last active October 8, 2018 05:56
Show Gist options
  • Select an option

  • Save ajitStephen/3cd0703e5d7994c9ea6f49e103e3a502 to your computer and use it in GitHub Desktop.

Select an option

Save ajitStephen/3cd0703e5d7994c9ea6f49e103e3a502 to your computer and use it in GitHub Desktop.
FManage Hierarchical Data
http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
htaccess
http://www.htaccess-guide.com/
Zend Projects
[email protected]:colinmccune/zend-training.git
Skype Notifications ON / OFF on any Chat window
/alertson
/alertsoff
sudo tar -cvzf backUp.tar.gz folder/ ->to make back up.
sudo tar -xvzf filename.tar.gz -> extract from back up
Remove Untracked files in GIT.
Step 1 is to show what will be deleted by using the -n option:
git clean -f -n
Clean Step - beware: this will delete files:
git clean -f
To remove directories, run git clean -f -d or git clean -fd
To remove ignored files, run git clean -f -X or git clean -fX
To remove ignored and non-ignored files, run git clean -f -x or git clean -fx
Note the case difference on the X for the two latter commands.
If clean.requireForce is set to "true" (the default) in your configuration, one needs to specify -fotherwise nothing will actually happen.
Again see the git-clean docs for more information.
XAMP mysql data import Command Line
/opt/lampp/bin/mysql -u root -p database < sqlFile.sql
XAMP mysql data export Command Line
/opt/lampp/bin/mysqldump -u root -p database > sqlFile.sql
Ignore chmod changes
git config core.fileMode false
Skype Title bar options application
sudo apt-get install sni-qt:i386
Hot keys for Parcellite
Ctrl + Alt + H => history
Ctrl + Alt + P => Menu Option
Efficient JS Debugging
https://dzone.com/articles/debug-javascript-with-these-14-tips
Installing Front End GIT
git init
git remote add sev4v https://USERNAME:[email protected]/BigStepTechnologies/SocialEngineAddOns-sev4v.git
chmod -R 777 .git
Now do GIT PULL from demo frontend (basePath/bigstep/index/git-up)
Deleting Directories and Files Recursively
http://andy-carter.com/blog/recursively-remove-a-directory-in-php
Node Js Install
https://www.youtube.com/watch?v=WeEKAhEm67Q
git diff --name-only <some-other-branch>
Install .deb from terminal
sudo dpkg -i /path/to/deb/file followed by sudo apt-get install -f
Permission command
sudo chmod -R 777 application/languages/ application/packages/ application/modules/ application/themes/ application/settings/ index.php public/ temporary/ install/config/
Git Revert Last Commit - add to unstaged changes(local)
git reset HEAD~
Inspact elements of android chrome page in chrome browser form
Enable developer tools on android
Type command
adb forward tcp:9222 localabstract:chrome_devtools_remote
rsync -avh --progress Source Destination
Kool Console Tricks
console.warn()
console.error()
Arr is array of objects console.table(arr)
https://applyhead.com
Permissions in number format
stat -c '%a - %n' *
New Chrome fix
I found solution that works for me. try these steps:
1. delete chrome repositories from ubuntu sources lists -
sudo rm /etc/apt/sources.list.d/google-chrome*
2. remove previously installed chrome version -
sudo apt remove google-chrome-*
3. remove all your local chrome configs -
rm -rf ~/.config/google-chrome*
4. and then reinstall google chrome again by typing following commands in your terminal one by one -
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
sudo apt update
sudo apt install google-chrome-stable
Format USB
First, you have to find out which device (/dev/sd??) your USB stick is. Therefore look at the output of
sudo fdisk -l
After that unmount the device/partition (if necessary) by running
sudo umount /dev/sd??
Make sure you replaced ?? with the correct device/partition name from the previous output.
To format The partition as FAT32 use
sudo mkdosfs -F 32 -I /dev/sd??
Again replace ?? with your respective letters.
For
fatal: Unable to create '/opt/lampp/htdocs/cionet/.git/index.lock': File exists.
rm -f ./.git/index.lock
Include viewScript from different module, in a form.
class Default_Form_MyForm extends Zend_Form
{
public function init()
{
// … other form initialisation ...
// do custom rendering of the form
$this->setDecorators(array(
array('ViewScript', array(
// the view template script
'viewScript' => 'forms/myformtemplate.phtml',
// the module that contains our view templates
'viewModule' => 'default'
))
));
}
}
Remove commit entirely from historical commits.
git rebase -p --onto SHA^ SHA
git log --pretty=oneline --abbrev-commit
git rebase -i HEAD~2 ::>> delete here the commit you want to drop
πŸ‘‰ ES6.io/friend/GITGUTTER
πŸ… ⭐ Sublime Text Book ⭐
πŸ‘‰ SublimeTextBook.com/friend/GITGUTTER
πŸ… ⭐ React For Beginners ⭐
πŸ‘‰ ReactForBeginners.com/friend/GITGUTTER
import mysql database .gz file:
zcat /home/bigstep/Downloads/cionet (1).sql.gz | ./mysql -u 'root' -p database
http://www.media-division.com/php-download-script-with-resume-option/
http://www.media-division.com/the-right-way-to-handle-file-downloads-in-php/
lit GIT branch on terminal:
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
unset color_prompt force_color_prompt
You can use xinput to float the input device under X.
Execute the command xinput list to list your input devices.
Locate AT Translated Set 2 keyboard and take note of its id number; this will be used to disable the keyboard. Also, take note of the number at the end, [slave keyboard (#)]; this is the id number of the master, which will be used to re-enable your keyboard.
To disable the keyboard, execute the command xinput float <id#>, where <id#> is your keyboard's id number. For example, if the id was 10, then the command would be xinput float 10.
To re-enable the keyboard, execute the command xinput reattach <id#> <master#>, where master is that second number we noted down. So if the number was 3, you would do xinput reattach 10 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment