Skip to content

Instantly share code, notes, and snippets.

View PyroGenesis's full-sized avatar

Burhanuddin Mustafa Lakdawala PyroGenesis

  • California, USA
View GitHub Profile
@PyroGenesis
PyroGenesis / pyproject.toml
Created January 25, 2024 02:08
poetry-autogen
[tool.poetry]
name = "local-demo"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "~3.10"
pyautogen = {path = "autogen", develop = true}
@PyroGenesis
PyroGenesis / windows-dark-mode.md
Last active May 17, 2024 18:23
Enable Windows Dark Mode via registry (no activation needed)
@PyroGenesis
PyroGenesis / Instructions.md
Last active May 6, 2024 06:37
Instructions for dumping stack information of Winforms application using WER

Instructions

  1. Follow the instructions here to enable WER. Make sure the DumpType is set to 2 (Full Dumps).
  2. Make a new Module (static Class in C#) called ProgramEntryPoint.
  3. Copy the code written below and don't forget to change YOUR_STARTUP_FORM_NAME_HERE.
  4. Change project configuration to Debug
  5. Go to Project Properties. In the Application tab, uncheck "Enable application framework".
  6. Change Startup Object to Sub Main.
  7. Go to Debug -> Windows -> Exception Settings and make sure Common Language Runtime Exceptions is checked (full checked and not partially checked).
  8. Now whenever an unhandled exception occurs, your application will quit and a .dmp file will be created in the folder specified in the DumpFolder registry key.
@PyroGenesis
PyroGenesis / 05-post-formdata.ts
Last active May 19, 2019 11:12
Angular request with Body (FormData and JSON)
POST_with_FormData(fileblob): Observable<any> {
const URL = 'YOUR_URL_HERE';
const data = new FormData();
data.append('product_Id', '123');
data.append('file', fileblob);
return this.httpClient.post<any>(URL, data); // returns an Observable
}
@PyroGenesis
PyroGenesis / 03-get_with_headers.ts
Last active May 19, 2019 11:10
Angular request with Headers
// GET request with headers
GET_with_headers(): Observable<any> {
const URL = 'YOUR_URL_HERE';
const headers: new HttpHeaders({
'Content-Type': 'application/json',
'Authorization': 'my-auth-token'
})
return this.httpClient.get(URL, { headers: headers }); // returns an Observable
}
@PyroGenesis
PyroGenesis / 04-get_with_params.ts
Last active May 19, 2019 11:11
Angular request with Parameters
// GET request with params
GET_with_params(): Observable<any> {
const URL = 'YOUR_URL_HERE';
const params = new HttpParams()
.set('param_key', 'param_value')
.set('param_key2', 'param_value2');
return this.httpClient.get(URL, { params: params }); // returns an Observable
}
#!/usr/bin/env python
"""
This script is used to remove / reset outputs, execution numbers and metadata from .ipynb files for better version control.
I created my own script to do this as I could not find any solution that performs all 3 operations properly.
Usage:
Put this script in the same directory as the jupyter notebook (.ipynb) files and run it.
Note:
@PyroGenesis
PyroGenesis / 01-simple-request.service.ts
Last active May 19, 2019 11:10
The simplest requests (GET and POST)
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
// Injectable indicates a dependency injectable service
// providedIn indicates the level at which components can access it
@Injectable({
providedIn: 'root'
})
export class SimpleRequestService {