Skip to content

Instantly share code, notes, and snippets.

View mihai-vlc's full-sized avatar

Mihai Ionut Vilcu mihai-vlc

View GitHub Profile
@mihai-vlc
mihai-vlc / my_docs.md
Last active August 29, 2015 14:17
A list of useful gists from my gist account.

Setup sourcetree as your git client

  1. Download and install sourcetree
  2. Open sourcetree and then go to Tools -> Options -> Diff tab -> Set both Diff and Merge tools to TortoiseMerge
  3. Download and install TortoiseSVN. It will contain the merge tool we need.
  4. Find the place where you installed TortoiseSVN (usually C:\Program Files\TortoiseSVN)
  5. Add the bin folder from there to your system path C:\Program Files\TortoiseSVN\bin. To edit on windows 7 go to Start -> Search variables (Edit environment variables)
@mihai-vlc
mihai-vlc / watch_c.sh
Created March 15, 2015 16:50
Watch a file c file and compile on change.
#!/bin/bash
FILE=$1
# make sure the file exists
if [ ! -f "$FILE" ]
then
echo -e "\x07File $1 doesn't exists !"
exit
fi

I needed to install ubuntu server 12.04 32bit on my virtual box.

Here are the steps to install:

Open a file with nano

nano test.c

Useful flags

  • -T 4 tab size 4
  • -i autoindent

Useful keyboard shortcuts

  • Select text with Ctrl + Shift + 6
start livereload .
start sass --watch styles/styles.scss:styles/styles.css
start http-server
var matchText = (function() {
var excludeElements = ['script', 'style', 'iframe', 'canvas'];
var mText = function(node, regex, callback) {
var child = node.firstChild;
var correctOffset = 0;
// if it's an empty element
if ( ! child) {
@mihai-vlc
mihai-vlc / run.cmd
Created January 4, 2015 15:55
Redirects `command` to `sh command`
:: redirects `egrep` to `sh egrep`
@echo off
sh egrep %*
@mihai-vlc
mihai-vlc / watch.js
Created December 4, 2014 11:35
Enable livereload in adaptivejs workflow
// 1. Run npm install grunt-contrib-watch --save
// 2. Add this in your Gruntfile.js file
grunt.loadNpmTasks('grunt-contrib-watch');
// 3. add this to your watch.js file
livereload: {
options: { livereload: true },
files: ['build/**/*.js', 'build/**/*.css'],
tasks: []
}
# Mihai Ionut Vilcu
# Nov 2014
# Get the js functions names at the cursor position
#
import sublime, sublime_plugin
from time import time
_last_run = 0