Skip to content

Instantly share code, notes, and snippets.

View naveedmurtuza's full-sized avatar

Naveed Quadri naveedmurtuza

View GitHub Profile
# Define paths
$pathX = "C:\path\to\x"
$pathY = "C:\path\to\y"
$pathZ = "C:\path\to\z"
# Define filenames
$fileName = "w.js"
$backupExtension = ".bk"
# Run 'npm run build' at path X
@naveedmurtuza
naveedmurtuza / IntegerByReference.java
Last active August 29, 2015 14:17
Common helper functions for JNI
package com.generic.jni.byref;
/**
* class to facilitate passing of integer values by reference.
* @author Naveed
*/
public class IntegerByReference {
private int value;
public IntegerByReference(int value) {
@naveedmurtuza
naveedmurtuza / TextToImage.cs
Created September 17, 2013 20:27
Converting text to image (png) C#
/// <summary>
/// Converting text to image (png).
/// </summary>
/// <param name="text">text to convert</param>
/// <param name="font">Font to use</param>
/// <param name="textColor">text color</param>
/// <param name="maxWidth">max width of the image</param>
/// <param name="path">path to save the image</param>
public static void DrawText(String text, Font font, Color textColor,int maxWidth,String path)
{
@naveedmurtuza
naveedmurtuza / CheckedComboBox.cs
Created July 11, 2013 12:05
CheckedComboBox Custom Control WPF
using System;
using System.Collections;
using System.Text;
using System.Windows;
using System.Windows.Controls;
namespace CryptoTools.UI.Controls
{
public class CheckedComboBox : ComboBox
@naveedmurtuza
naveedmurtuza / FullTextLuceneEx.java
Created July 11, 2013 11:58
Modified H2 database FullTextLucene.java, Added another column(FIELDCOLUMNS) in INDEXES table for the column names whose values will be stored as it is in the index(Field.Store.YES).required for filtering results depending on those values
package org.almuallim.database;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@naveedmurtuza
naveedmurtuza / TextToImage.java
Created July 11, 2013 11:40
Converting text to transparent image
package org.almuallim.utils;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;