Skip to content

Instantly share code, notes, and snippets.

@searls
searls / tailwind.config.js
Created March 21, 2023 23:40
A sample Tailwind configuration file, heavily inspired by @PixelJanitor
function spacing () {
const scale = Array(201)
.fill(null)
.map((_, i) => [i * 0.5, `${i * 0.5 * 8}px`])
const values = Object.fromEntries(scale)
values.px = '1px'
values.xs = '2px'
values.sm = '4px'
return values
}
@cetoh
cetoh / Microsoft.PowerShell_profile.ps1
Created May 23, 2022 22:21
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
@c64cosmin
c64cosmin / exportscript.py
Created June 29, 2021 20:00
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
@lhuxman-lhux
lhuxman-lhux / yt.php
Last active June 15, 2023 19:06
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 / dosu.php
Created August 6, 2019 06:19 — forked from karthikax/dosu.php
PHP Download file to server from URL
<html>
<p style="width: 70%;margin: auto;margin-top: 5%;font-size:larger;text-align:center">
Download a file from any URL</p>
<form method="post" style="width: 70%;margin: auto;margin-top: 10%;">
<input name="url" size="50" placeholder="Source URL" style="width: 100%;height: 10%;font-size: 1.5em;padding:10px" required>
<input name="submit" type="submit" value="Download" style="width: 30%;height: 10%;margin: 5% auto; display: block;">
<p style="width: 70%;margin: auto;margin-top: 10%;font-size:larger;text-align:center">
To <?php echo getcwd(); ?></p>
<p style="width: 70%;margin: auto;font-size: smaller;text-align: center;position: fixed;bottom: 0;background: #fff;">
Powered by: <a href="https://karthikbhat.net/portfolio" target="_blank" style="color:#f60;text-decoration:none;">Karthik</a></p>
@erajanraja24
erajanraja24 / gist:2c51e76f906c49f341f331920111aca3
Created December 16, 2018 11:35
Scrape Google search results -Title, URL by Location
function scrapeGoogle() {
var searchResults=UrlFetchApp.fetch("https://www.google.co.uk/search?q="+encodeURIComponent("keyword finder tool")+"&num=30",{muteHttpExceptions:true});
var titleExp=/<h3 class=\"r\">([\s\S]*?)<\/h3>/gi;
var urlExpression=/<h3 class=\"r\">([\s\S]*?)\&amp\;/gi;
var titleResults=searchResults.getContentText().match(titleExp);
@MBRCTV
MBRCTV / meganz.php
Last active April 30, 2023 20:54
Mega.nz Direct Link Generator
<?php
echo '<html><head><title>Mega downloader</title></head><body><h2>Enter Url</h2><form action="mega.php" method="POST"> <br> URL: <input type="text" name="URL"> <br><input type="submit" value="Submit"></form>';
if ($_POST) {
error_reporting(0);
$url = $_POST['URL'];
preg_match("/!(.+?)!/", $url, $output_array);
@guruguruman
guruguruman / ScrapingProxyProvider.php
Last active January 24, 2021 14:33
Rotate public listed proxies per each request in PHP.
<?php
/**
* A class which provide public listing proxies rotated when client request.
*/
Class ScrapingProxyProvider
{
// Proxies available.
private $proxyDatas = array();
@wildiney
wildiney / bearer-token.php
Last active February 11, 2024 18:55
[deprecated] PHP - How to get and set Bearer Token
<?php
/**
* ALERT! There are more than ten years since I wrote the first version (adaptation) of this code with PHP 5.6,
* then I changed my code stack and I couldn't mantain this code anymore. Ten years ago worked like a charm.
* Fell free to test, use, fork, update, etc. and if possible put in the comments how to fix,
* if it doesn't work for you as it is, so other people could find answers.
**/
/**
* Get hearder Authorization
@gale93
gale93 / premake5.lua
Last active April 5, 2023 12:43
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/**.*" }