Skip to content

Instantly share code, notes, and snippets.

@TheCoderRaman
TheCoderRaman / paint
Created September 13, 2023 08:38 — forked from robopuff/paint
Draw image in terminal (True Color) with PHP
#!/usr/bin/env php
<?php
define('VERSION', '1.0.24');
define('DEFAULT_PIXEL', "\xE2\x96\x84");
define('RC', "\e[0m");
define('RCNL', RC . PHP_EOL);
define('CURRENT_FILE', array_shift($argv));
error_reporting(0);
@TheCoderRaman
TheCoderRaman / Microsoft.PowerShell_profile.ps1
Created July 3, 2023 20:51 — forked from cetoh/Microsoft.PowerShell_profile.ps1
PowerShell Profile including Oh My Posh, Terminal Icons, PSReadLine IntelliSense, and z
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
Import-Module -Name Terminal-Icons
@TheCoderRaman
TheCoderRaman / yt.php
Created June 15, 2023 19:06 — forked from lhuxman-lhux/yt.php
youtube download
<?php
if (file_exists('sig1.php')) {
unlink('sig1.php');
}
function getc($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
@TheCoderRaman
TheCoderRaman / download_file.php
Created June 8, 2023 10:35 — forked from saleemkce/download_file.php
PHP File Download Script - Download large file in chunks.
<?php
/*ini settings*/
set_time_limit(0);
ini_set('memory_limit', '512M');
//DOWNLOAD SCRIPT
$filePath = "G:/Software/versions/..PATH TO DOWNLOAD FILE...zip"; // set your download file path here.
download($filePath); // calls download function
function download($filePath)
{
@TheCoderRaman
TheCoderRaman / premake5.lua
Created April 5, 2023 12:43 — forked from gale93/premake5.lua
SFML's premake5 build script
workspace "sfml_project"
configurations { "Debug", "Release" }
location "build"
project "sfml_project"
kind "ConsoleApp"
language "C++"
targetdir "bin/%{cfg.buildcfg}"
files { "src/**.*" }
@TheCoderRaman
TheCoderRaman / exportscript.py
Created January 20, 2023 06:39 — forked from c64cosmin/exportscript.py
Export 8 angles in Blender
import bpy
import os
def rotate_and_render(angle, output_dir, output_set):
newcamera = "Camera.00"+str(angle)
bpy.context.scene.camera = bpy.context.scene.objects[newcamera] #set camera
bpy.context.scene.render.filepath = os.path.join(output_dir, output_set+str(angle)+".png") #set export path
bpy.ops.render.render(write_still = True) #start rendering
@TheCoderRaman
TheCoderRaman / https-on-localhost.md
Created January 10, 2023 06:53 — forked from adnan360/https-on-localhost.md
Use HTTPS on Localhost (XAMPP, Windows)

Sometimes some websites require https to work. This can be useful in those cases.

This has been tested with XAMPP (PHP 7.0.8) on Windows 7. Please see the Reference links at the end if in confusion about some step.

STEP 1: Editing Configs

Open:

C:\xampp\php\php.ini
@TheCoderRaman
TheCoderRaman / awesome-php.md
Created January 9, 2023 13:40 — forked from llbbl/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks
@TheCoderRaman
TheCoderRaman / gist:b770eca829208167f62c6d18288cfd44
Created September 3, 2022 13:37 — forked from plasticbrain/gist:3887245
PHP: mime types (array format)
<?php
$mime_types = array(
'.3dm' => 'x-world/x-3dmf',
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
'.aam' => 'application/x-authorware-map',
'.aas' => 'application/x-authorware-seg',
'.abc' => 'text/vnd.abc',
'.acgi' => 'text/html',
@TheCoderRaman
TheCoderRaman / generate_timezone_list.php
Created September 3, 2022 06:35 — forked from hotmeteor/generate_timezone_list.php
[PHP] Generate a timezone list with optgroups
/**
* Inspired by http://stackoverflow.com/questions/1727077/generating-a-drop-down-list-of-timezones-with-php
* @return array
*/
function generate_timezone_list()
{
static $regions = [
'Africa' => DateTimeZone::AFRICA,
'Americas' => DateTimeZone::AMERICA,