Skip to content

Instantly share code, notes, and snippets.

View irazasyed's full-sized avatar
🎯
WIP

Irfaq Syed irazasyed

🎯
WIP
View GitHub Profile
@irazasyed
irazasyed / laravel-scheduler.md
Created August 12, 2018 05:22
Laravel Scheduler Manual Simulation

Simulate Laravel Scheduler Manually

This command will execute every 60 seconds which will trigger your Laravel schedules in 1 min range.

while true; do php artisan schedule:run; sleep 60; done
@irazasyed
irazasyed / dark-youtube.js
Last active April 4, 2023 18:37
User-Script: YouTube Dark & Wide Mode.
// ==UserScript==
// @name Dark Wide YouTube
// @namespace DWYT
// @version 1.0
// @description Dark Wide YouTube
// @author Syed I.R.
// @match https://*.youtube.com/*
// @require https://raw.githubusercontent.com/madmurphy/cookies.js/master/cookies_min.js
// @grant none
// @noframes
@irazasyed
irazasyed / binance-registration-workaround.md
Created January 6, 2018 23:15
Binance Registration Work-Around

Binance Registration Work-Around

Binance as you know has taken over Bittrex in terms of volume and has been performing quite well with coin listings every week happening and interesting contests. However, due to the huge number of registrations on their platform, they have temporally closed registrations. But there is still a work-around to register an account with Binance despite the registrations being closed.

Here's a way to easily register an account with Binance:

Just follow this link and register an account as you would normally and enjoy! Do share with others too :)

@irazasyed
irazasyed / tunnel-valet.sh
Created June 25, 2017 01:43
Laravel Valet Share with Sub-Domain Support
# Tunnels to valet project with custom domain name.
# Uses ngrok.com with my personal github account and auth token
function tunnel_valet() {
HOST="${PWD##*/}"
DOMAIN=$(valet domain)
SUBDOMAIN="$HOST"
[[ "$1" ]] && SUBDOMAIN=$1;
for linkname in ~/.valet/Sites/*; do
if [[ "$(readlink $linkname)" = "$PWD" ]]
@irazasyed
irazasyed / weight-utility.php
Created January 8, 2016 09:21
PHP: Utility function for getting random values with weighting.
<?php
/**
* getRandomWeightedElement()
* Utility function for getting random values with weighting.
* Pass in an associative array, such as array('A'=>5, 'B'=>45, 'C'=>50)
* An array like this means that "A" has a 5% chance of being selected, "B" 45%, and "C" 50%.
* The return value is the array key, A, B, or C in this case. Note that the values assigned
* do not have to be percentages. The values are simply relative to each other. If one value
* weight was 2, and the other weight of 1, the value with the weight of 2 has about a 66%
* chance of being selected. Also note that weights should be integers.
@irazasyed
irazasyed / README.md
Last active May 5, 2024 02:06
Fix for Google Chrome - Update failed (error 11)

Fix for Google Chrome - Update failed (error 11)

How to Fix Google Chrome Update Failed (error 11) Issue on Mac OSX

If you've tried to update your Google Chrome and the update failed because of the error 11 issue, Then here's a simple and easy solution that'll let you update your Google Chrome again and fix the issue once & for all.

First try fixing with the following instructions on this page: https://support.google.com/chrome/answer/111996?hl=en&rd=1

If it fails, try below:

@irazasyed
irazasyed / keybase.md
Created August 9, 2015 13:30
Keybase

Keybase proof

I hereby claim:

  • I am irazasyed on github.
  • I am irazasyed (https://keybase.io/irazasyed) on keybase.
  • I have a public key whose fingerprint is EDD2 641F 4759 31FD 3E86 DCBC A5B1 D2F5 0417 EF74

To claim this, I am signing this object:

@irazasyed
irazasyed / README.md
Last active June 24, 2017 23:13
Shell: Initial Server Setup

Simple Ubuntu Server Setup

Bash script i personally use to setup a new server initially.

Fire the following command:

wget -qO https://git.io/voICQ && sudo bash
@irazasyed
irazasyed / laravel-version.php
Last active October 10, 2017 08:16
PHP: Check if Laravel version is 4 in Service Provider. To be used in Service Providers.
<?php
/**
* Laravel Version Check
*
* @return bool
*/
private function isLaravel4()
{
return version_compare(get_class($this->app) . '::VERSION', '5', '<');
@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1