Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home #StayAtHome

Anthony Da Mota AkdM

🏠
Working from home #StayAtHome
View GitHub Profile
@AkdM
AkdM / Edit_Repack_ISO_tutorial.md
Last active Jun 12, 2021
Edit and repack .iso bootable image
View Edit_Repack_ISO_tutorial.md

On Linux

Installing mkisofs

apt-get install mkisofs

Editing ISO image

mkdir /tmp/custom_iso

@AkdM
AkdM / amd.js
Last active Apr 15, 2021
AMD.js
View amd.js
// ==UserScript==
// @name AMD Button
// @version 0.1
// @description YAY
// @author AkdM
// @match https://www.amd.com/*/direct-buy/*
// @icon https://www.google.com/s2/favicons?domain=amd.com
// @grant none
// ==/UserScript==
@AkdM
AkdM / addToCart.js
Last active Apr 8, 2021
Add to Bookmark
View addToCart.js
javascript: (async function () {
const t = (t) => (document.querySelector(".page-title").innerText = t);
try {
t("looking for product id...");
var e = (() => document.location.pathname.split("/").filter((t) => /\d{10}/.test(t))[0])();
t("adding to cart..."), await ((t) => fetch(`https://www.amd.com/en/direct-buy/add-to-cart/${t}`, { credentials: "include", method: "GET", mode: "cors", redirect: "error" }))(e), t("added to cart, fetching checkout URL...");
var a = await (async () => {
var t = await fetch("https://www.amd.com/en/direct-buy/shopping-cart/modal?_wrapper_format=drupal_modal", { credentials: "include", method: "POST", mode: "cors" });
return (await t.text()).match(/\/.{2}\\\/direct-buy\\\/checkout\\\/payment\\\/\d*\\\/.{2}/)[0].replace(/\\/g, "");
})();
@AkdM
AkdM / gulpfile.js
Last active Nov 16, 2020
Gulp 4 - gulp.watch fix (done callback)
View gulpfile.js
// This tricks prevents the reload-only-once 'new' feature
// of Gulp 4, when using gulp.watch
'use strict';
var gulp = require('gulp'),
sass = require('gulp-sass'),
electron = require('electron-connect').server.create();
// You should also add a 'clean' task to clean the dist folder
@AkdM
AkdM / gist:49ae1d4115246a057526
Created Oct 24, 2014
Convert annotation to YAML for Symfony 2
View gist:49ae1d4115246a057526
php app/console doctrine:mapping:convert --namespace="MySuper\DuperBundle\Entity\MyEntity" yaml src/MySuper/DuperBundle/Resources/config/doctrine
That command will convert the annotation file into yaml format into src/MySuper/DuperBundle/Resources/config/doctrine as MySuper.DuperBundle.Entity.MyEntity.orm.yml
@AkdM
AkdM / myfile.html
Last active Jul 21, 2020
Dynamically populate dropdowns with JSON and jQuery
View myfile.html
<label>Country:</label>
<select id="country" name="country">
<option value="000">-Select Country-</option>
</select>
<br />
<label>State:</label>
<select id="state" name="state">
<option value="000">-Select State-</option>
View dbus_cheatsheet.md

Requirements

  • qdbus (sudo apt install qdbus)

Commands

List services

qdbus

@AkdM
AkdM / cornersAndShadow.swift
Last active Jun 18, 2019
Swift Playground: Corner Radius + Shadow
View cornersAndShadow.swift
import UIKit
import PlaygroundSupport
// For the Playground only: creating an UIView where the next UIView will be shown on
let container = UIView(frame: CGRect(x: 0, y: 0, width: 500, height: 500))
container.backgroundColor = .white
// The interesting stuff
let viewShadow = UIView(frame: CGRect(x: 0, y: 0, width: 120, height: 120))
viewShadow.center = container.center
@AkdM
AkdM / zsh_speed.sh
Last active Sep 18, 2018
ZSH launch speed command
View zsh_speed.sh
# One line:
TIMEFMT=$'real %E\tuser %U\tsys %S' && repeat 10 {time zsh -i -c exit}
# Two lines:
TIMEFMT=$'real %E\tuser %U\tsys %S'
repeat 10 {time zsh -i -c exit} # or only this line if you don't mind the formatting
@AkdM
AkdM / userChrome.css
Last active Sep 14, 2018
Personal userChrome based on arc-firefox theme
View userChrome.css
.tabbrowser-tab[selected="true"] {
width: 100%;
visibility: visible;
color: blue;
}
.tab-throbber[busy]::before {
content: "";
position: absolute;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAhOAAAITgBRZYxYAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABtCSURBVHja7d19kF11fcdxd0kIiYnRISQIiIABUjBSE8oQEOIUUURtKBqeFFokaqA6oExpBzBjBitghU5bichTQTKoVSwQBMHiDIJg1FoIBWVQYYgGCAKxYEhCdtPv0bOddWVz7+7eh9/vnNcfrxlGycOc35nzebN7995XbNmy5RUAQL24CAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQC0xSEfe3pC2C3MC+8tzSv/twmuEQgAoBqDPyUcE64La8OWBtaW/27xa6a4hiAAgLyG/8jwzbChidEfzoby9zjSNQUBAKQ9/HPDd8Yw+sMpfs+5rjEIACCt4Z9efum+vw3jP6C//DOmu+YgAIDuj/+c8Hgbh3+o4s+a49qDAAC6N/7Hh/UdHP8BxZ95vDMAAQB0fvzP6cLwD3WOswABAHRu/BcmMP4DjnUmIACA9o//fuGFhAJgvdcEgAAA2jv+24dHExr/AavDDGcEAgBoTwBcnuD4D/iSMwIBALR+/PcJmxMOgL7wJmcFAgBobQCsSHj8B9zirEAAAK0b//kZjP+A+c4MBADQmgBYnlEALHdmIACAsY//+PBcRgFQ/F3HOzsQAMDYAuDwjMZ/wOHODgQAMLYAWJZhACxzdiAAgLEFwIMZBsCDzg4EADC2AFiXYQC