Skip to content

Instantly share code, notes, and snippets.

View computerline1z's full-sized avatar

Albert Luzx computerline1z

View GitHub Profile
@computerline1z
computerline1z / paste_to_browser_console.js
Created February 21, 2023 17:24
OpenAI for Jupyter Notebook
// base https://copilot.naklecha.com
// https://bevel-pufferfish-154.notion.site/Getting-started-with-Copilot-7be0d614295a4836b84fb9cf7c909227
const generate = async (prompt) => {
// Get your API key from storage
const key = "<YOUR OPENAI API KEY>";
const url = 'https://api.openai.com/v1/completions';
// Call completions endpoint
const completionResponse = await fetch(url, {
@computerline1z
computerline1z / gist:96083e0d5d55c5a91e1d2b8470b37e25
Created October 21, 2022 18:59 — forked from codler/gist:3906826
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
public ActionResult Controllers()
{
var asm = Assembly.GetAssembly(typeof(Lottery.WebAdmin.Startup));
var controlleractionlist = asm.GetTypes().Where(type => typeof(Controller).IsAssignableFrom(type)).
SelectMany(type =>
type.GetMethods(BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public)).
Where(m => !m.GetCustomAttributes(typeof(CompilerGeneratedAttribute), true).Any()).Select(x => new
{
Controller = x.DeclaringType?.Name,
Action = x.Name,
@computerline1z
computerline1z / CustomSwagger.js
Created April 20, 2021 19:49 — forked from hubert17/CustomSwagger.js
Add bearer token automatically to Swagger UI using Swashbuckle Asp.Net Core
(function () {
function getJwt(user, pass, success, error, complete) {
//console.log('getJwt ', user);
$.ajax({
url: '/TOKEN',
type: 'POST',
contentType: "application/json",
dataType: "json",
data: JSON.stringify({
var file = cs.getSystemPath(SystemPath.EXTENSION) + "/jsx/chuc_nang_1.jsx";
cs.evalScript('$.evalFile("' + file + '")');
const keyRegisterOverride = () => {
const platform = navigator.platform.substring(0, 3);
let maxKey;
if (platform === 'Mac')
maxKey = 126; // Mac Max Key Code
else if (platform === 'Win')
maxKey = 222; // HTML Max Key Code
let allKeys = [];
for (let k = 0; k <= maxKey; k++) {
for (let j = 0; j <= 15; j++) {
@computerline1z
computerline1z / readme.md
Created February 26, 2021 19:53 — forked from mattiasghodsian/readme.md
How to create a Windows application Installer with NSIS

Nullsoft Scriptable Install System is also known as NSIS open-source system to create Windows application installers. NSIS is a script-based system allowing you to create the logic behind your installer/setup file in a complex way to install tasks. NSIS offers plug-ins and other scripts, for example, to download/install 3rd-party files or communicate with Windows.

The tutorial application

This tutorial will guide you through installing and creating your first Windows installer with Nullsoft Scriptable Install System and how to compile your project. Captura Portable will be used as "our application" for the sake of this tutorial.

Installation

Head to NSIS official site and download the latest release and install it. Run NSIS and you will be welcomed with a menu like below, It's always a good practice to read the Documentation before jumping in t

@computerline1z
computerline1z / Windows Defender Exclusions VS 2017.ps1
Created September 22, 2020 03:00
Adds Windows Defender exclusions for Visual Studio 2019
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio') > $null
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using z.A_B;
namespace XSS.Core
{
class XSSTest : Core
@computerline1z
computerline1z / vietlot_test.py
Created April 12, 2020 20:22
Sample get data vietlot
#!/usr/bin/env python
# coding: utf-8
# In[11]:
import requests
import json
from IPython.core.display import display, HTML