Skip to content

Instantly share code, notes, and snippets.

View musamamasood's full-sized avatar
🎯
Focusing

Muhammad Usama Masood musamamasood

🎯
Focusing
View GitHub Profile
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 2, 2024 11:24
crack activate Office on mac with license file
@jebog
jebog / mysql_backup.sh
Created December 16, 2017 15:15
A script to backup mysql with a cron job
#!/bin/bash
# Configuration de base: datestamp e.g. YYYYMMDD
DATE=$(date +"%Y%m%d")
# Dossier où sauvegarder les backups (créez le d'abord!)
BACKUP_DIR="/backup/mysql"
@scmx
scmx / update-diverged-branch-with-git-checkout-B.md
Created April 7, 2017 07:01
Updating a local diverged git branch to latest remote without reset --hard. #git git checkout -B vs git reset --hard

Updating a local diverged git branch to latest remote without reset --hard

Sometimes you have a branch checked out locally that someone else owns and they do a force push. Perhaps it's during a review when they have pushed all the needed fixups and got them approved. So now they squash and force-push the branch. It's time for you to take a new look at the updated commits, so you checkout the branch and try to update it.

The situation

$ git checkout some-topic-branch
$ git pull
@justintadlock
justintadlock / font-awesome.php
Last active September 28, 2021 11:09
PHP array of Font Awesome icons.
<?php
// Font Awesome v. 4.6.
function jt_get_font_icons() {
return array(
'fa-glass' => 'f000',
'fa-music' => 'f001',
'fa-search' => 'f002',
'fa-envelope-o' => 'f003',
@smutek
smutek / post_format_icon.php
Created March 9, 2016 03:22
Function for Post Format icons
<?php
/**
* Output Post Format icons
*
* Outputs an icon for each post format. Set up to use Fontawesome,
* but can be used with anything, or you can just use CSS.
*
* @return string
*/
function post_format_icon() {
#!/usr/bin/env bash
# Wayback machine downloader
#TODO: Remove redundancy (download only newest files in given time period - not all of them and then write over them)
############################
clear
#Enter domain without http:// and www.
domain="google.com"
#Set matchType to "prefix" if you have multiple subdomains, or "exact" if you want only one page
matchType="domain"
@salcode
salcode / .gitignore
Last active April 3, 2024 18:38
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@stevenslack
stevenslack / class-drop-walker-nav.php
Last active November 24, 2020 07:53
WordPress Walker Nav extended to add data attributes for Drop support
<?php
/**
* Extends WordPress nav menu by adding data attributes and
* markup for Drop by Chris Ferdinandi
*
* Version 6.1.1
*
* drop source: https://github.com/cferdinandi/drop
*/
@frzsombor
frzsombor / gist:ddd0e11f93885060ef35
Last active December 7, 2023 00:05
Share Laravel's session and check authentication from external projects
<?php
/*
|--------------------------------------------------------------------------
| Sharing Laravel's session and checking authentication
|--------------------------------------------------------------------------
|
| Use the following code in any CMS (WordPress, Joomla, etc), filemanager (CKFinder,
| KCFinder, simogeos's Filemanager, etc), or any other non-Laravel project to boot into
| the Laravel framework, with session support, and check if the user is authenticated.

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);