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 / CityList.json
Last active April 3, 2020 08:10
Indian City List for Forecast
[
{ "order_index": -2, "forecast" : [], "updated_at": "", "city" : "Amravati" , "state" : "Andhra Pradesh" , "imd" : "99961", "ow": "" , "city_hindi": "अमरावती" , "city_urdu": "", "state_hindi": "आंध्र प्रदेश", "state_urdu": "" },
{ "order_index": 0, "forecast" : [], "updated_at": "", "city" : "Itanagar" , "state" : "Arunachal Pradesh" , "imd" : "42308", "ow": "" , "city_hindi": "ईटानगर" , "city_urdu": "", "state_hindi": "अरुणाचल प्रदेश", "state_urdu": "" },
{ "order_index": 0, "forecast" : [], "updated_at": "", "city" : "Dispur" , "state" : "Assam" , "imd" : "99979", "ow": "1272508", "city_hindi": "दिसपुर" , "city_urdu": "", "state_hindi": "असम", "state_urdu": "" },
{ "order_index": 0, "forecast" : [], "updated_at": "", "city" : "Patna" , "state" : "Bihar" , "imd" : "42492", "ow": "1260086", "cit
@amitkhare
amitkhare / TextCounter.cs
Last active March 24, 2020 09:50
UserControl for Counting text of given textbox
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
@amitkhare
amitkhare / TwitterHelper.cs
Last active March 16, 2020 11:45
TwitterHelper API
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Collections.Generic;
using System.Windows.Forms;
namespace TwitterHelper
{
public class Twitter
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace amitkhare
{
class W3DGraph
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace amitkhare
{
struct Float2
{
private System.Threading.Timer timer;
private void SetUpTimer(TimeSpan alertTime)
{
DateTime current = DateTime.Now;
TimeSpan timeToGo = alertTime - current.TimeOfDay;
if (timeToGo < TimeSpan.Zero)
{
return;//time already passed
}
this.timer = new System.Threading.Timer(x =>
using System.Linq;
// ......................
// ......................
List<int> vals;
List<float> heights;
private void Calculate()
{
vals = new List<int>();
#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;
@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]);
}
@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