Skip to content

Instantly share code, notes, and snippets.

View pavanyogi's full-sized avatar
🎯
Focusing

Pavan Yogi pavanyogi

🎯
Focusing
  • Bengaluru, India.
View GitHub Profile
@ChriRas
ChriRas / readme.md
Last active June 30, 2024 08:26
Set up default audio device on Ubuntu 20.04 LTS

Problem

I have a notebook connected to a port replicator. I want to use the build-in speakers and microfone and not the external ones. If I boot my notebook in my port replicator Ubuntu changes the devices to external.

Solution

  1. Find your internal speaker
pactl list short sinks
@tfeldmann
tfeldmann / duplicates.py
Last active May 26, 2024 03:18
Fast duplicate file finder written in python
#!/usr/bin/env python
"""
Fast duplicate file finder.
Usage: duplicates.py <folder> [<folder>...]
Based on https://stackoverflow.com/a/36113168/300783
Modified for Python3 with some small code improvements.
"""
import os
import sys
@bradtraversy
bradtraversy / eslint_prettier_airbnb.md
Created July 19, 2019 17:54
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@omegachien
omegachien / BookController.php
Created March 10, 2019 06:13
DataTable Example - Book Controller - Load Data via Ajax
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Yajra\DataTables\DataTables;
class BookController extends Controller
{
public function index()
@omegachien
omegachien / datatable.ajax.blade.php
Created March 10, 2019 06:10
DataTable Example - Load Data via Ajax
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
<title>DataTable Sample</title>
<!-- Fonts -->
@traviswaelbro
traviswaelbro / split_csv.py
Last active January 3, 2024 14:42
Split a CSV file into multiple CSVs of a certain number of rows.
# This is mostly copied from [this answer on Stack Overflow](https://stackoverflow.com/a/49452109/3330552)
# (Thanks [Ryan Tuck](https://github.com/ryantuck)!)
# except that I've included the dependencies and set this up to be called from the command line.
#
# Example call from bash to split a single CSV into multiple 100 line CSVs:
# python3 split_csv /path/to/my/file.csv /path/to/split_files my_split_file 100
#
# Warning: This doesn't have any validation! This will overwrite existing files if you're not careful.
import csv
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active July 3, 2024 14:45 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@manthey
manthey / Dockerfile-histomicstk-jupyter
Created August 27, 2018 18:29
Minimal Ubuntu 18.04 Dockerfile to run Jupyter examples for HistomicsTK
FROM ubuntu:18.04
# Prerequisites and runtimes
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
build-essential \
git \
python-dev \
python-pip \
python-setuptools \
python-wheel \
@ebetancourt
ebetancourt / wp-disable-plugin-update.php
Last active June 6, 2024 09:57 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
<?php
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {