Skip to content

Instantly share code, notes, and snippets.

View mihai-vlc's full-sized avatar

Mihai Ionut Vilcu mihai-vlc

View GitHub Profile

Tips and tricks about git commands

Autosquash

Sometimes we need to add a small fix to a commit we made some while ago. In order to keep the commit history clean we can squash our commits using git rebase -i <parent_commit>. If we use --fixup when commiting the fix later on when we rebase the commit will be reordered to the correct position and squashed read more.

git commit --fixup c8cf4f
git rebase -i --autoshquash 
@mihai-vlc
mihai-vlc / compare.js
Last active August 29, 2015 14:23
Compare Demandware library files
/**
* Compare 2 library files for matching folders ids and content assets
* @author: Mihai Ionut Vilcu <ionutvmi@gmail.com>
* Jun 2015
*/
var parseString = require('xml2js').parseString;
var fs = require('fs');
@mihai-vlc
mihai-vlc / addToolbarButton.reg
Last active August 29, 2015 14:23
Add a ZIP button to the explorer toolbar
Windows Registry Editor Version 5.00
;; http://www.experts-exchange.com/articles/2173/Add-a-Custom-Command-Button-to-the-Windows-7-Explorer-Toolbar.html
;; this script will add the tool #0
;; to add multiple keys replace /0 with the next number in senquence
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksItemsSelected]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksItemsSelected\0]
/////////////////////////////////////////////////////
// npm i --save lodash.template //
// npm i --save fast-csv //
// @author: Mihai Ionut Vilcu <ionutvmi@gmail.com> //
// Jun 2015 //
// Example usage: node geolocation-import.js //
/////////////////////////////////////////////////////
var template = require('lodash.template');
var fs = require('fs');
@mihai-vlc
mihai-vlc / useful_tools.md
Last active August 29, 2015 14:23
Useful windows tolls

A list of useful small tools for windows

Turn off pc

Download Turn off pc
This is is a gadget that will allow you to schedule the system restart or shutdown after a certain interval. To use it enter the interval in minutes and press the action button (shutdown, restart)

Launchy

Download Launchy
The best tool for launching programs with your keyboard alone.

Keybase proof

I hereby claim:

  • I am ionutvmi on github.
  • I am ionutvmi (https://keybase.io/ionutvmi) on keybase.
  • I have a public key whose fingerprint is 232B AFE3 929C 5AF0 4E6E EDF8 4203 8E83 5D8D CCCC

To claim this, I am signing this object:

@mihai-vlc
mihai-vlc / backup_gists.js
Last active September 8, 2015 12:53
backup_gists.js
// Backup all your gists
// prerequisite: npm install request
// Mihai Ionut Vilcu <ionutvmi@gmail.com>
// Mar 2013
// Licence: MIT
var request = require('request'),
user = 'username here',
path = require('path'),
fs = require('fs'),

Add a new macro in MS Office Word 2010

Build the macro

  • Go to File -> Options -> Customize Ribbon
  • From the right side panel check Developer and click OK
  • A new tab Developer is now available
  • Go to Developer -> Macros -> Insert a name in the input box and click Create
  • A text editor window shows up where you can add your code

Developing in DW

Setup the workspace

Note: You can skip these steps if you import the pref.epf file listed below.

  1. Go to Window -> Open Perspective -> Other -> Demandware development
  2. Go to Window -> Open Perspective -> Debug
  3. On the left sidebar under the navigator tab click the Link with editor button (two arrows)
  4. Go to Window -> Preferences -> General -> Editors -> Text Editors -> Check Show line numbers
  5. Go to Window -> Preferences -> General -> Editors -> Text Editors -> Check Show Whitespace characters
@mihai-vlc
mihai-vlc / read_file.md
Created March 22, 2015 13:02
Read the content of a file from the command line

Read the content of a file from the command line

Using the cat command

# show the full content of a file
cat filename
# if you provide multiple arguments it will show the content in order
cat file1 file2