Skip to content

Instantly share code, notes, and snippets.

View professorhaseeb's full-sized avatar
🎯
Focused

Haseeb ur Rehman professorhaseeb

🎯
Focused
View GitHub Profile
@yspkm
yspkm / How to change qemu.conf.md
Created October 23, 2023 03:31
How to use QEMU GUI (virt-manager)

How to Configure Access for qcow2 in virt-manager

If you've created a qcow2 virtual disk, you might have noticed that it's not internally accessible even when you access it using sudo virt-manager. To fix this, we need to make a few changes to the /etc/libvirt/qemu.conf file.

1. Locate the Configuration File: The configuration file is found at /etc/libvirt/qemu.conf.

2. Modify the User and Group Settings: Find the lines that specify the user and group for QEMU processes. The default settings look like:

@loilo
loilo / pass-slots.md
Last active February 20, 2025 09:47
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@heyalexej
heyalexej / pytz-time-zones.py
Created November 16, 2016 09:14
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
@brunogaspar
brunogaspar / README.md
Last active October 7, 2022 09:08
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@nickshek
nickshek / PlaceHolderController.php
Created June 5, 2016 15:11
Simple PlaceHolder API using Laravel and Intervention
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Intervention\Image\ImageManager;
class PlaceHolderController extends Controller
@ivan-loh
ivan-loh / request.lua
Created November 16, 2015 04:21
sample lua http get
local http = require "socket.http"
local data = ""
local function collect(chunk)
if chunk ~= nil then
data = data .. chunk
end
return true
end

#Codevember - Day 1

Codevember and ten lines challenge. I have no idea why this looks different on Firefox vs Chrome.

Inspired by Neon Orbit.

A Pen by Giana on CodePen.

License.

@kjantzer
kjantzer / remove-wp-admin-header.php
Last active May 29, 2019 19:21
Globally remove default WordPress Admin Header. Courtesy of David Walsh (http://davidwalsh.name/remove-wordpress-admin-bar-css)
add_action('get_header', 'remove_admin_login_header');
function remove_admin_login_header() {
remove_action('wp_head', '_admin_bar_bump_cb');
}
@compact
compact / dropzone-directive.js
Last active March 16, 2024 02:55
AngularJS directive for Dropzone.js
/**
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/
*
* Usage:
*
* <div ng-app="app" ng-controller="SomeCtrl">
* <button dropzone="dropzoneConfig">
* Drag and drop files here or click to upload
* </button>
* </div>
@benbalter
benbalter / parse-csv.php
Created July 24, 2012 22:28
Parse CSV into Associative Array
<?php
$lines = explode( "\n", file_get_contents( 'input.csv' ) );
$headers = str_getcsv( array_shift( $lines ) );
$data = array();
foreach ( $lines as $line ) {
$row = array();
foreach ( str_getcsv( $line ) as $key => $field )