Skip to content

Instantly share code, notes, and snippets.

View JunaidQadirB's full-sized avatar
🎯
Social Media Fasting

Junaid Qadir JunaidQadirB

🎯
Social Media Fasting
View GitHub Profile
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};
@JunaidQadirB
JunaidQadirB / song_dot_pk_player.js
Created August 23, 2011 18:11
This is a Bookmarklet which parses specific pages (those which are showing a list of linked audio files) for songs and adds to the MP# Player's (http://flash-mp3-player.net) playlist and displays the player on top of the page. * This is helpf
/*
* This is a Bookmarklet which parses specific pages (those which are showing a list of linked audio files) for songs and adds to the MP# Player's (http://flash-mp3-player.net) playlist and displays the player on top of the page.
* This is helpful suppose I want to download only the songs I like.
* @author Junaid Qadir Baloch (shekhanzai.baloch@gmail.com)
* @version 0.1 Tue Aug 23 15:04:14 PKT 2011
*
*/
javascript: (function (e, a, g, h, f, c, b, d) {
if (!(f = e.jQuery) || g > f.fn.jquery || h(f)) {
c = a.createElement("script");
@mrchief
mrchief / LICENSE.md
Last active March 23, 2024 12:28
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@Harti
Harti / Searchable
Last active March 13, 2020 21:24
Overriding trait for laravel/scout's Searchable trait, to hide unpublished instances from the search
<?php
namespace App\Models\Traits;
use Illuminate\Support\Collection;
trait Searchable
{
use \Laravel\Scout\Searchable;
@wanmigs
wanmigs / Testcase.php
Last active October 18, 2023 10:42
Create, Update, Delete and Fetch TestCase
<?php
namespace Tests;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;

Electron is tricky to get set up on Windows Subsystem for Linux, but it can work!

Four things needed overall:

  1. you need WSL2, not WSL1
  2. you need node, of course, and that part isn't so bad
  3. you need to apt install several dependencies
  4. you need an X Server so it can display the electron GUI over in Windows-land

Setup instructions, in order:

@syaffers
syaffers / color_distance.c++
Created December 4, 2020 10:08
Color distance c++ code from compuphase
typedef struct {
unsigned char r, g, b;
} RGB;
double ColourDistance(RGB e1, RGB e2)
{
long rmean = ( (long)e1.r + (long)e2.r ) / 2;
long r = (long)e1.r - (long)e2.r;
long g = (long)e1.g - (long)e2.g;
long b = (long)e1.b - (long)e2.b;
@psobot
psobot / kos_file_dumper.py
Last active June 13, 2023 16:27
Kurzweil KOS File Packer/Unpacker
"""
Kurzweil K2500/K2600 KOS operating system update file packer/repacker
by Peter Sobot, Nov 6, 2021
@psobot / github@petersobot.com
Requirements: none! Pure Python. Just use Python 3.2+.
"""
import os
import math