Skip to content

Instantly share code, notes, and snippets.

DinisCruz-Dev

Block or report user

Report or block DinisCruz-Dev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 1.original sample code.html
<!DOCTYPE html>
<meta charset="utf-8" >
<title>WebSocket Test></title>
<script language="javascript" type="text/javascript">
var wsUri = "ws://echo.websocket.org/";
var output;
@DinisCruz-Dev
DinisCruz-Dev / eclipse_karma_views.groovy
Last active Aug 29, 2015
Create a Eclipse views to show AngularJS tests executed with Karma
View eclipse_karma_views.groovy
eclipse.views.create("Karma Runner")
.clear()
.add.browser()
.open("http://localhost:9879/__karma/")
eclipse.views.create("Website")
.clear()
.add.browser()
.open("http://localhost:9879/index.html")
@DinisCruz-Dev
DinisCruz-Dev / 1. send 1000 pushes to firebase in c#.cs
Last active Aug 29, 2015
Script to test Firebase and C# performace
View 1. send 1000 pushes to firebase in c#.cs
var msgSent = 1;
var errors = 0;
Action<string,string,string,string> sendMessage =
(app,token, area, message)=>
{
ThreadPool.QueueUserWorkItem((o)=>
{
var url = "https://{0}.firebaseio.com/{1}.json?auth={2}".format(app, area, token);
var now = DateTime.Now. TimeOfDay; //DateTime.Now.ToShortTimeString();
var data = "\"[{0}] {1}\"".format(now, message.replace("\"", "'"));
View 1. hook TeamMentor BeginRequest and send url to firebase.c#
Action<string,string,string,string> sendData_Raw =
(app,token, area, data)=>
{
ThreadPool.QueueUserWorkItem((o)=>
{
var url = "https://{0}.firebaseio.com/{1}.json?auth={2}".format(app, area, token);
var now = DateTime.Now.ToShortTimeString(); // DateTime.Now. TimeOfDay;
var postData = "\"{0}: {1}\"".format(now, data.replace("\"", "'"));
url.POST(postData);
});
@DinisCruz-Dev
DinisCruz-Dev / _views_messages.html
Last active Aug 29, 2015
Nice Simple AngularJS + Firebase + C# REST PoC.
View _views_messages.html
<h5>Current messages:</h5>
<table class="table table-striped">
<thead>
<tr>
<th>message</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="message in messages" >
@DinisCruz-Dev
DinisCruz-Dev / 1. Groovy script to auto open an browser based on folder change.groovy
Last active Aug 29, 2015
Groovy script to auto open an browser based on folder change (same as the last example on https://gist.github.com/DinisCruz-Dev/9214909/ but on a separate gist so that it embeds ok in a blog post)
View 1. Groovy script to auto open an browser based on folder change.groovy
import java.nio.file.*;
import com.sun.nio.file.*
import java.nio.file.attribute.*;
def editorTitle = "index.html"
def refreshBrowser = { path ->
eclipse.log("Opening browser with: " + path);
def view = eclipse.views.create("Synced WebBrowser");
if (view.controls().size() == 0)
@DinisCruz-Dev
DinisCruz-Dev / 01. get file name from loaded editor.groovy
Last active Aug 29, 2015
Groovy scripts to parse Blogger export xml
View 01. get file name from loaded editor.groovy
def editor = eclipse.editors.get("blog-02-28-2014 (1).xml").getEditor(true);
def xmlFile = editor.getEditorInput().fileStore.toString();
return xmlFile;
@DinisCruz-Dev
DinisCruz-Dev / 1. final script.groovy
Last active Aug 29, 2015
Eclipse Groovy script to remove loading Icon from Default webbrowser
View 1. final script.groovy
def visible = false;
for(editor in eclipse.editors.list())
if (editor.id == "org.eclipse.ui.browser.editor")
editor.getEditor(true).webBrowser.busy.visible = visible;
@DinisCruz-Dev
DinisCruz-Dev / 1. index.html
Created Mar 1, 2014
Simple AngularJS app with Firebug lite
View 1. index.html
<!DOCTYPE html>
<html ng-app>
<head>
<meta charset="UTF-8">
<title>Angular example (with Firebug lite)</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script>
<script src="https://getfirebug.com/firebug-lite-debug.js" ></script>
<link href ="http://angularjs.org/css/bootstrap.min.css" rel="stylesheet" ></link>
</head>
<script type="text/javascript">
View 2. revert to self , invoke cmd.exe but fail to invoke ipconfig.exe.cs
"System.Web.dll".assembly().type("UnsafeNativeMethods").invokeStatic("RevertToSelf");
return "cmd.exe".startProcess_getConsoleOut("/c ipconfig");
return WindowsIdentity.GetCurrent().Name; // stays the same
You can’t perform that action at this time.