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 / 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 / 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
{
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 / 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);
@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 / 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 / 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 / pm2start.sh
Created July 14, 2018 05:45
PM2 Start server
pm2 kill
pm2 start /var/www/<PATH>/server.js -i max --name "NAME"
@amitkhare
amitkhare / server.js
Last active June 20, 2018 10:34
Express + Socket.IO Server
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendFile(__dirname + '/public/default.html');
})
app.use('/', express.static('public'));
// Run from the dev tools console of any Youtube video
// Accurate as of June 23, 2017.
// ES6 version
const videoUrls = ytplayer.config.args.adaptive_fmts
.split(',')
.map(item => item
.split('&')
.reduce((prev, curr) => (curr = curr.split('='),
Object.assign(prev, {[curr[0]]: decodeURIComponent(curr[1])})