Skip to content

Instantly share code, notes, and snippets.

View amitkhare's full-sized avatar
🤔
Brainstorming

Amit Kumar Khare amitkhare

🤔
Brainstorming
View GitHub Profile
@amitkhare
amitkhare / 001 how-to.txt
Last active April 1, 2023 04:17
Setup C9 IDE in digitalocean
Requirements
Putty prefered if you are in Windows.
JuiceSSH if you choose to do all this from android phone
https://play.google.com/store/apps/details?id=com.sonelli.juicessh
A digitalocean account, if you dont have one, create one with this link
https://bit.ly/do-credit
You will get $10 credit in you digitalocean account once you spend $25 with them.
create digitalocean account, verify it.
create droplet.
@amitkhare
amitkhare / WASP3D List Files.cs
Last active September 4, 2019 03:58
WASP3D List Files
/*
VARIABLES TO CREATE
WInteger
imgIndex : 0
imgTotal : 0
WString
imgPath : ""
selectedFile : ""
WBoolean
isComplete : false
@amitkhare
amitkhare / ae.jsx
Created June 30, 2019 06:24
ae split each line display over time
index = timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false);
lines = value.split("\r");
lines[index];
@amitkhare
amitkhare / adobe_illustrator_path_batch_rename.jsx
Last active June 19, 2022 13:34
Adobe Illustrator path batch rename
#target illustrator
var docRef = app.activeDocument;
with (docRef) {
//int j = items.pathItems[0];
// layers[0].name = "Layer 1";
alert(app.activeDocument.pathItems[0].name + "");
for(var i =0; i < app.activeDocument.pathItems.length; i++) {
app.activeDocument.pathItems[i].name = pad((i+1), 3);
var maxValue = 500;
var maxAngle = 180;
var minAngle = 0;
var rotation = (maxAngle/maxValue * a);
rotation = (rotation >= maxAngle) ? maxAngle : rotation;
result = (rotation <= minAngle) ? minAngle : rotation;
@amitkhare
amitkhare / GenerateRowsOffset.cs
Last active November 12, 2019 11:09
#WASP3D, #Csharp : Get transform position for newly created items
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace amitkhare
{
public class Row
{
@amitkhare
amitkhare / ControlMoverOrResizer.cs
Last active December 7, 2019 06:17
C# Control Mover Or Resizer
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Windows.Forms;
namespace ControlManager
{
internal class ControlMoverOrResizer
@amitkhare
amitkhare / Csharp_RemoveEvent.cs
Created December 11, 2019 17:39
C# Remove all handlers from any event
private void RemoveEvent(object item, string eventStr = "DoubleClick")
{
FieldInfo f1 = typeof(Control).GetField("Event"+ eventStr,
BindingFlags.Static | BindingFlags.NonPublic);
object obj = f1.GetValue(item);
PropertyInfo pi = item.GetType().GetProperty("Events",
BindingFlags.NonPublic | BindingFlags.Instance);
EventHandlerList list = (EventHandlerList)pi.GetValue(item, null);
list.RemoveHandler(obj, list[obj]);
}
#region NameSpaceRegion
using System;
using System.Windows.Forms;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Xml;
using System.Xml.Linq;
using System.Linq;
// ......................
// ......................
List<int> vals;
List<float> heights;
private void Calculate()
{
vals = new List<int>();