Skip to content

Instantly share code, notes, and snippets.

@marioflores
marioflores / simple-drop-down
Created November 7, 2013 12:48
Simple Angular Drop Down
<!DOCTYPE html>
<html ng-app="">
<head>
<title>Banner Onclick Code</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js"></script>
<script>
function bannerCode($scope) {
$scope.programs=[
{name:'Appellate'},
@marioflores
marioflores / maven-commands
Created September 24, 2013 13:48
Maven Commands
Create project from archetype
mvn archetype:generate –DarchetypeCatalog
@marioflores
marioflores / crontab
Created September 23, 2013 15:21
Cron Management
crontab -e Edit your crontab file, or create one if it doesn’t already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.)
@marioflores
marioflores / reload-bashrc
Created September 12, 2013 11:39
Reload bashrc
source ~/.bashrc
@marioflores
marioflores / global-gitignore
Created September 11, 2013 12:47
Global Gitignore
View
git config --get core.excludesfile
Set
git config --global core.excludesfile ~/.gitignore_global
@marioflores
marioflores / tail-command-for-powershell
Created September 10, 2013 14:08
Tail Command for Powershell
Get-Content -Path "C:\scripts\test.txt" -Wait
@marioflores
marioflores / Copy command line results to clipboard
Created August 9, 2013 15:55
Copy command line results to clipboard
ex. dir | clip
@marioflores
marioflores / new_gist_file
Created July 31, 2013 15:57
Checkout current branch
git checkout master
@marioflores
marioflores / new_gist_file
Created July 31, 2013 15:00
Restore files with Git
If the deletion has not been committed, the command below will restore the deleted file in the working tree.
$ git checkout -- <file>
You can get a list of all the deleted files in the working tree using the command below.
$ git ls-files --deleted
If the deletion has been committed, find the commit where it happened, then recover the file from this commit.
$ git rev-list -n 1 HEAD -- <file>
$ git checkout <commit>^ -- <file>
@marioflores
marioflores / new_gist_file
Created July 11, 2013 11:33
Perfect Ajax request
$.ajax({
type: 'POST',
url: 'http://kyleschaeffer.com/feed/',
data: { postVar1: 'theValue1', postVar2: 'theValue2' },
beforeSend:function(){
// this is where we append a loading image
$('#ajax-panel').html('<div class="loading"><img src="/images/loading.gif" alt="Loading..." /></div>');
},
success:function(data){
// successful request; do something with the data