Skip to content

Instantly share code, notes, and snippets.

View cyberpirate92's full-sized avatar
🖖
live long and prosper

Ravi Theja cyberpirate92

🖖
live long and prosper
View GitHub Profile
@cyberpirate92
cyberpirate92 / SampleHandler.java
Created January 19, 2017 08:25
The sample handler code in eclipse PDT
package my_first_plugin.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.jface.dialogs.MessageDialog;
/**
package my_first_plugin;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
package my_first_plugin.handlers;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleListener;
@cyberpirate92
cyberpirate92 / temp.java
Last active February 6, 2017 06:49
Temp #1
public void mouseScrolled(MouseEvent arg0) {
if(arg0.count == -3) {
if(!allLinesRead) {
loadLines(traceFileName);
}
}
}
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
int main() {
int T, n, q, i;
vector< vector<int> > field;
@cyberpirate92
cyberpirate92 / LdapClient.java
Created March 22, 2017 06:59
Example: How get user info from LDAP
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
import javax.xml.registry.infomodel.User;
import java.io.FileOutputStream;
var z = {
name: 'Bill',
age: 30
}
Object.keys(z); // ['name', 'age']
Object.defineProperty(z, 'name', { enumerable: false });
Object.keys(z); // ['age']
@cyberpirate92
cyberpirate92 / index.html
Last active June 1, 2018 19:16
SignalR_LiveGraph
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SignalR Real time graph</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
<script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
import java.util.Base64;
import java.util.Scanner;
import java.util.concurrent.atomic.AtomicInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.nio.charset.StandardCharsets;
public class HashBreaker
{
public static void main(String[] args) throws NoSuchAlgorithmException {
@cyberpirate92
cyberpirate92 / GoogleAnalyticsReportingv4ServiceAccount.cs
Created October 5, 2018 05:56 — forked from markwemekamp/GoogleAnalyticsReportingv4ServiceAccount.cs
Read data from Google analytics using Google Analytics Reporting v4 and a Service account
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Google.Apis.AnalyticsReporting.v4;
using Google.Apis.AnalyticsReporting.v4.Data;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
namespace Google_api