Skip to content

Instantly share code, notes, and snippets.

<?php
namespace FrontEndBundle\Request\ParamConverter;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Doctrine\Common\Persistence\ObjectRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
abstract class AbstractBySlugAndActiveSearcher
@Microtribute
Microtribute / Alien.java
Last active April 23, 2020 19:28
Java Annotation Example
package com.example.demo;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Alien {
@Microtribute
Microtribute / rule.js
Created April 21, 2020 18:04 — forked from vktr/rule.js
Add Stripe Customer Id to Auth0 via custom rule
function (user, context, callback) {
user.app_metadata = user.app_metadata || {};
if ('stripe_customer_id' in user.app_metadata) {
context.idToken['https://example.com/stripe_customer_id'] = user.app_metadata.stripe_customer_id;
return callback(null, user, context);
}
var stripe = require('stripe')('sk_....');
var customer = {
@Microtribute
Microtribute / fstab
Last active August 23, 2020 04:50
Directory mounting through /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=caccca41-8abb-4bb4-a65e-fba8142a55ce / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
@Microtribute
Microtribute / ffmpeg.md
Created May 5, 2020 12:39 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

Keybase proof

I hereby claim:

  • I am microtribute on github.
  • I am microtribute (https://keybase.io/microtribute) on keybase.
  • I have a public key ASApo38YDVWGAQ8VV_mrgchfp5vvUqy99_tXnHNzM6iZmwo

To claim this, I am signing this object:

/*
* Quick Tags Google Chrome Extension
* https://chrome.google.com/webstore/detail/quick-tabs/jnjfeinjfmenlddahdjdmgpbokiacbbb
*
* Custom comfortable style
*/
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
* {
@Microtribute
Microtribute / postback.js
Created July 29, 2020 14:26
Smadex Postback
(function () {
var u=`https://geo-tracker.dsp.flowershop.media/hyperad/pixel-tracking?order=111466&action=buy&t=${new Date().getTime()}`;
document.createElement('img').src = u;
})();
@Microtribute
Microtribute / Click URL Macros.md
Last active August 4, 2020 16:06
Macros to attach to click urls by default

Click URL Macros

Macro

(click-id)={$CLICK_ID$}&(lat)={$LAT$}&(lon)={$LON$}&(idfa)={$IDFA_RAW_UPPER$}&(dpid)={$DPID_UPPER$}&(wpid)={$WPID_RAW_UPPER$}&(gaid)={$GAID_RAW_UPPER$}&(ip)={$IP_ADDRESS$}&(ua-enc)={$USER_AGENT_ENCODED$}&(creative-id)={$CRID$}&(line-id)={$LINE_ID$}&(campaign-id)={$CAMPAIGN_ID$}&(app-id)={$APP_ID$}&(app-name)={$APP_NAME$}&(app-bundle)={$APP_BUNDLE$}&(app-category)={$APP_CATEGORIES$}&(device-os)={$DEVICE_OS$}&(dnt)={$DNT$}

Examples

https://www.basaf.com/store/menu?utm_source=FSM&amp;(click-id)={$CLICK_ID$}&amp;(lat)={$LAT$}&amp;(lon)={$LON$}&amp;(idfa)={$IDFA_RAW_UPPER$}&amp;(dpid)={$DPID_UPPER$}&amp;(wpid)={$WPID_RAW_UPPER$}&amp;(gaid)={$GAID_RAW_UPPER$}&amp;(ip)={$IP_ADDRESS$}&amp;(ua-enc)={$USER_AGENT_ENCODED$}&amp;(creative-id)={$CRID$}&amp;(line-id)={$LINE_ID$}&amp;(campaign-id)={$CAMPAIGN_ID$}&amp;(app-id)={$APP_ID$}&amp;(app-name)={$APP_NAME$}&amp;(app-bundle)={$APP_BUNDLE$}&amp;(app-category)={$APP_CATEGORIES$}&amp;(device-os)={$DEVICE_OS$}&amp;(dnt)={$DNT$}
@font-face {
font-family: SegoeUI;
src:
local("Segoe UI Light"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format("woff2"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format("woff"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format("truetype");
font-weight: 100;
}