Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Saadh Shehzed inoicouldalwaysturn2u

🎯
Focusing
Block or report user

Report or block inoicouldalwaysturn2u

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@inoicouldalwaysturn2u
inoicouldalwaysturn2u / javascript-nested-ternary-vs-switch-case.js
Last active Jul 5, 2019
Javascript nested ternary vs switch case. Which is better?
View javascript-nested-ternary-vs-switch-case.js
# Easier to copy paste from what I was doing. Working on a React Component.
# Was working with React and d3. So the functions are imported from d3.
import { axisTop, axisRight, axisBottom, axisLeft } from 'd3-axis';
# Ternary example as a small function
ternaryEx = ( bootstrap ) => bootstrap === 'top' ? axisTop :
bootstrap === 'right' ? axisRight :
bootstrap === 'bottom' ? axisBottom :
axisLeft;
View keybase.md

Keybase proof

I hereby claim:

  • I am inoicouldalwaysturn2u on github.
  • I am chase_ats (https://keybase.io/chase_ats) on keybase.
  • I have a public key ASDnT4Kj1NyrLglQz8Un2DUb84JO8U_MJ8Pxbp3Qv5oB0go

To claim this, I am signing this object:

View shop-css-overwrite.css
.shopify-buy__layout-horizontal:not(.no-image) .shopify-buy__product-img-wrapper {
float: none !important;
width: 100% !important;
}
.shopify-buy__product-img-wrapper {
float: none !important;
width: 100% !important;
}
View Shazam all songs to youtube and spotify.js
// change this variable to change timeout for async scroll load
var TIMEOUT_IN_MS = 1000
// script from https://gist.github.com/xavhan/87717da0217b9b8299df
// start from www.shazam.com/myshazam
// print all shazam songs loaded on the page
// TODO: Change format to JSON
function printShazamSongs(){
$(".details").each(function(i){
var artist = $(this).find(".artist meta").attr("content");
@inoicouldalwaysturn2u
inoicouldalwaysturn2u / launchd-script-to-keep-macos-app-running-at-all-times.plist
Last active May 3, 2017
Launchd script to keep a macOS app to always run even if it closes randomly (issue I'm having from crashes). Place in ~/Library/LaunchAgents and run <code>launchctl load ~/Library/LaunchAgents/FILENAME.plist</code>
View launchd-script-to-keep-macos-app-running-at-all-times.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>App.restart</string>
View macos-spotlight-rebuilding-sierra-2017.sh
#!/bin/sh
# Turn off spotlight.
sudo mdutil -a -i off
# Remove the index files.
sudo rm -rfv /.Spotlight-V100
# Turn on spotlight.
sudo mdutil -a -i on
@inoicouldalwaysturn2u
inoicouldalwaysturn2u / disable-reopening-apps-windows-MacOS-modern-versions-post-Lion
Last active Apr 12, 2017
Disables the reopening of applications and windows for modern MacOS versions. For some reason on the latest Sierra patch, my apps and windows are reopening.
View disable-reopening-apps-windows-MacOS-modern-versions-post-Lion
#!/bin/bash
# curl https://gist.githubusercontent.com/inoicouldalwaysturn2u/69042c23228578a6725a298ae5ac7fe2/raw/9c6b3d51281c9e7d3883fbc644aa968fe1768a01/disable-reopening-apps-windows-MacOS-modern-versions-post-Lion -L -s -o ~/.local/bin/fixlogin.sh
# chmod +x ~/.local/bin/fixlogin.sh && sudo ~/.local/bin/fixlogin.sh ; rm ~/.local/bin/fixlogin.sh
echo "#!/bin/bash" > /tmp/loginfix.sh
echo "rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*" >> /tmp/loginfix.sh
mv /tmp/loginfix.sh /usr/local/bin/loginfix.sh
chmod +x /usr/local/bin/loginfix.sh
defaults write com.apple.loginwindow LoginHook /usr/local/bin/loginfix.sh
@inoicouldalwaysturn2u
inoicouldalwaysturn2u / wget
Created Mar 18, 2017 — forked from bueckl/wget
Wget examples
View wget
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
View youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
View install_latest_chromedrive_linux.sh
# because I'll already have a chromedriver installed
sudo mv -f /usr/local/bin/chromedriver /usr/local/bin/chromedriver-old
sudo apt-get install unzip &&
a=$(uname -m) &&
rm -r /tmp/chromedriver/
mkdir /tmp/chromedriver/ &&
wget -O /tmp/chromedriver/LATEST_RELEASE http://chromedriver.storage.googleapis.com/LATEST_RELEASE &&
if [ $a == i686 ]; then b=32; elif [ $a == x86_64 ]; then b=64; fi &&
latest=$(cat /tmp/chromedriver/LATEST_RELEASE) &&
wget -O /tmp/chromedriver/chromedriver.zip 'http://chromedriver.storage.googleapis.com/'$latest'/chromedriver_linux'$b'.zip' &&
You can’t perform that action at this time.