Skip to content

Instantly share code, notes, and snippets.

Avatar

Ahmad Ajmi ahmadajmi

View GitHub Profile
View home.hbs
<div class='c-section'>
{{#get 'pages' slug='PAGE_SLUG' as |page| }}
{{#page}}
<div class='c-content'>
{{ content }}
</div>
{{/page}}
{{/get}}
</div>
View page-header.hbs
{{!--
Used in the post.hbs & page.hbs file
--}}
<header class='c-page-header'>
<div class='{{#if custom_excerpt}}o-grid o-grid--2-columns{{/if}} {{#unless custom_excerpt}}no-custom_excerpt{{/unless}}'>
<div>
<h1 class='c-page-header__heading u-font-heading'>{{ title }}</h1>
{{#match primary_tag.slug 'writing'}}
<time class='u-color-text-secondary u-font-size-small u-mt-8' datetime='{{ date format='YYYY-MM-DD' }}'>{{ date format='MMM D, YYYY' }}</time>
View Dropdown.md

Code Injection (Site Header)

<style>
    @media (max-width: 63.99em) {
  .c-nav__dropDown {
    margin-left: var(--space-16);
  }
  .c-nav__dropDown .c-nav__item {
    margin-bottom: 0;
@ahmadajmi
ahmadajmi / unfollow.js
Created May 18, 2022 — forked from JamieMason/unfollow.js
Unfollow everyone on twitter.com
View unfollow.js
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// Last Updated: 09 April 2020
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
View card-author-mini.hbs
<div class='c-card-author-mini'>
{{#if profile_image}}
<div class='c-card-author-mini__media'>
<img class='c-card-author-mini__image lazyload' data-src='{{ img_url profile_image size='profile-image-medium' }}' alt='' width='64' height='64'>
</div>
{{/if}}
<div class='c-card-author-mini__content'>
<h3 class='c-card-author-mini__name'><a href='{{ url }}'>{{ name }}</a></h3>
<p class='c-card-author-mini__bio'>{{{ bio }}}</p>
@ahmadajmi
ahmadajmi / delete-likes-from-twitter.md
Created Feb 11, 2022 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter
View delete-likes-from-twitter.md

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@ahmadajmi
ahmadajmi / deploy-theme.yml
Last active Jan 11, 2022
Deploy a Ghost theme to different installs.
View deploy-theme.yml
name: Beirut Theme Deploy
on:
push:
branches:
- master
- main
- deploy
jobs:
deploy:
runs-on: ubuntu-18.04
View gulpfile.js
(function() {
'use strict';
// Include Gulp & Plugins
var gulp = require('gulp'),
sass = require('gulp-sass')(require('sass')),
rtlcss = require('gulp-rtlcss'),
cleanCSS = require('gulp-clean-css'),
autoprefixer = require('gulp-autoprefixer'),
View gist:a9d3a69856520db014f01e535ac54d9b
<script>
$(document).ready(function() {
// =====================
// Members subscription
// =====================
// Parse the URL parameter
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, '\\$&');
View gist:76e5da69d8b0f8ce25782de906fc5f00
<li class='c-social-icons__item'>
<a href='#' aria-label='Spotify' target='_blank' rel='noopener'>
<span class='c-social-icons__icon' data-size='s'>
<svg enable-background="new 0 0 512 512" width='18' height='18' style='vertical-align:top;' id="Layer_1" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M507,257.1c0,2.5-0.1,5,0,7.5c1.2,43.2-11.5,82.9-33.5,119.3c-40.5,67-99.8,108.7-177.4,119.5 c-99,13.8-179.6-21-240.1-100.7C29.8,368.3,14.8,328.8,10.4,286c-8.3-82.4,17-153.1,76.8-210.6c41.6-40,91.8-62.9,149.2-67.1 c91.8-6.7,166.4,27.1,222.7,100c26,33.7,41.4,72.3,46.7,114.6c1.4,11.3,0.2,22.8,0.2,34.3C506.3,257.1,506.7,257.1,507,257.1z M207.8,139.3c-9.5,0.7-24.6,1.4-39.7,3c-22.4,2.2-44.5,6.1-66,12.9c-12.5,4-19,16.8-15.2,29.1c3.8,12.2,16.5,19.1,29,15.4 c30.1-8.9,60.9-12.6,92.1-13.6c30.2-1,60.2,0.9,90,5.9c37.6,6.3,74,16.7,107.3,36c12.2,7.1,26.2,3.8,33-7.8 c6.8-11.5,2.9-25.7-9.7-32.5c-11.7-6.3-23.6-12.