Skip to content

Instantly share code, notes, and snippets.

View Samnan's full-sized avatar
⚒️

Samnan ur Rehman Akhoond Samnan

⚒️
View GitHub Profile
@Samnan
Samnan / readme.md
Created April 4, 2022 09:08 — forked from darwin/readme.md
APFS Container cloning/replicating under Catalina (with a bootable system)

Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. I upgraded my late 2014 Mac Mini with a shiny new 1TB SSD. This took way too many hours of my life I will never get back. Hope this saves some time to you.

Good news:

  1. it is possible to create a DMG image from existing APFS container with macOS Catalina installation including metadata needed for complete restore (the DMG contains OS, OS Data, Preboot, Recovery and VM volumes)
  2. it is possible to restore this DMG image into empty APFS container and get a bootable copy of the original system

This information is relevant for Catalina (I'm currently running macOS 10.15.1).

@Samnan
Samnan / Has weird right-to-left characters.txt
Created December 27, 2020 17:19 — forked from endolith/Has weird right-to-left characters.txt
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@Samnan
Samnan / disable.sh
Created January 8, 2020 05:00
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
// tooltip , i used in http://fbviralpictures.com/
(function(jQuery) {
jQuery.fn.k_tooltip = function(options) {
var defaults = {
use: 'title',
tooltipClass: 'tooltip'
};
var options = jQuery.extend(defaults, options),
@Samnan
Samnan / sample.html
Created July 1, 2011 07:01 — forked from kaichen/sample.html
html5 video sample w/ jquery.tmpl
<!doctype html>
<html>
<head>
<title>Html5 video with jq.tmpl sample</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
<script type="text/javascript">
$(document).ready(function () {
@Samnan
Samnan / html5-upload-progress.js
Created June 27, 2011 11:02 — forked from ambethia/html5-upload-progress.js
HTML5 Upload Progress
var xhr = new XMLHttpRequest();
xhr.upload['onprogress'] = function(xhrpe) {
console.log(xhrpe);
};
var file = document.getElementById('source').files[0];
xhr.open("POST", this.action, true);
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
@Samnan
Samnan / rounded_corners_table.sass
Created June 25, 2011 06:57 — forked from solnic/rounded_corners_table.sass
Here's how to do a table with rounded corners in CSS3
@import compass/reset
@import compass/css3/border-radius
table
border: none
border-collapse: separate
th, td
padding: 5px
thead
background-color: #f2f6fa
@Samnan
Samnan / CSS3_Clock.html
Created June 25, 2011 06:32 — forked from tschmidt/CSS3_Clock.html
A clock made using CSS3 techniques and a little bit of JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS 3 clock face</title>
<style type='text/css'>
* {
margin: 0;
padding: 0;
@Samnan
Samnan / logo.html
Created June 25, 2011 06:26 — forked from TdroL/logo.html
HTML5/CSS3 Shifted logo
<h1 data-content="Graphic portfolio">Graphic portfolio</h1>