Skip to content

Instantly share code, notes, and snippets.

@mgol
mgol / jquery-es6-example.md
Last active October 12, 2023 10:34
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone git@github.com:jquery/jquery.git

Then, write the following index.html file:

@fousa
fousa / FairPlayer.swift
Last active June 1, 2023 12:28
Integrate HLS with FairPlay.
class FairPlayer: AVPlayer {
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue")
func play(asset: AVURLAsset) {
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be
// triggered when FairPlay handling is required.
asset.resourceLoader.setDelegate(self, queue: queue)
// Load the asset in the player.
@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=Time Capsule,adVF=0x82</txt-record>
</service>
<service>
@andreaantonioni
andreaantonioni / ios-cell-registration-swift.md
Last active July 15, 2021 13:41 — forked from gonzalezreal/ios-cell-registration-swift.md
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func register(_ cellClass: AnyClass?, forCellReuseIdentifier identifier: String)
public func register(_ nib: UINib?, forCellReuseIdentifier identifier: String)
@oliverbaptiste
oliverbaptiste / cardigans-gran-turismo-guitar-player.md
Created January 3, 2017 06:17
A Track-by-Track Tour of The Cardigans' Gran Turismo

A Track-by-Track Tour of The Cardigans' Gran Turismo

By Kyle Swenson
Guitar Player, January 1999

Swedish popsters the Cardigans dumped an earful of sugar on the world with their 1997 smash hit, "Lovefool." Based on the song''s sparse guitars and bubble-gum chorus, you probably wouldn''t think of the band as raving experimentalists. But the Cardigan''s fourth album, Gran Turismo [Mercury], is a revelation of strange and rather unexpected guitar sounds. For example, you might think you''re hearing a guitar synth, a harpischord, or a pedal synth, a harpischord, or a pedal steel, but you''re not. All of the album''s sounds are production tricks conjured by guitarist Peter Svensson and producer Tore Johansson.

What's more, not one guitar track on Turismo was recorded using an amp. The guitars were either recorded direct or processed through Line 6's Amp Farm plug-in for Digidesign's Pro Tools. (For a full product review on Amp Farm, see "Virtual Vintage" in the Nov. '98 GP.) And although Amp Farm can de

@herrernst
herrernst / .fonts.conf
Created July 25, 2016 09:20 — forked from anonymous/.fonts.conf
Reduce hinting amount for fonts on linux
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM '/etc/fonts/fonts.dtd'>
<fontconfig>
<match target="font">
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>
</fontconfig>
anonymous
anonymous / .fonts.conf
Created January 20, 2016 16:39
Reduce hinting amount for fonts on linux
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM '/etc/fonts/fonts.dtd'>
<fontconfig>
<match target="font">
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>
</fontconfig>
@gonzalezreal
gonzalezreal / ios-cell-registration-swift.md
Last active March 13, 2024 15:18
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)
@tegansnyder
tegansnyder / disable mcafee endpoint protection.md
Last active December 26, 2023 03:18
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload