Skip to content

Instantly share code, notes, and snippets.

View ajmalafif's full-sized avatar
💻

Ajmal Afif ajmalafif

💻
View GitHub Profile
# Admin API key goes here
KEY="[FIND ME IN THE ADMIN SETTINGS]"
# Split the key into ID and SECRET
TMPIFS=$IFS
IFS=':' read ID SECRET <<< "$KEY"
IFS=$TMPIFS
# Prepare header and payload
NOW=$(date +'%s')
{
"color": {
"amber": {
"amber1": {
"value": "hsl(39, 70.0%, 99.0%)",
"type": "color"
},
"amber2": {
"value": "hsl(40, 100%, 96.5%)",
"type": "color"
@KoryNunn
KoryNunn / handshake-airdrop.md
Last active March 12, 2024 07:03
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.

@kmelve
kmelve / create-community-newsletter.js
Created December 8, 2020 23:33
Create Mailchimp campaign document action proof of concept
const fetch = require('got');
const client = require('../client');
const HTML = require('../lib/newsletter-template');
const MAILCHIMP_URL = 'https://us3.api.mailchimp.com/3.0/campaigns';
const API_TOKEN = process.env.MAILCHIMP_TOKEN;
const QUERY = `//groq
*[
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@adapptor-kurt
adapptor-kurt / idb-workaround.py
Created August 14, 2020 01:12
Helps Flipper connect to physical iOS devices more reliably.
#!/usr/bin/env python3
# See https://github.com/facebook/flipper/issues/262
import os
import sys
import syslog
import shlex
import time
import subprocess
@bzerangue
bzerangue / videoEmbed.js
Last active November 17, 2021 15:06
videoEmbed.js contentType - preview component for Sanity.io CMS richText PortableText editor - based off of Knut's YouTube Preview, https://www.youtube.com/watch?v=kLsER_zHiS4
import React from 'react'
const VideoEmbedPreview = ({ value }) => {
const url = value.url
const responsiveVideoContainer = {
padding: "56.25% 0 0 0",
position: "relative"
}
@ajmalafif
ajmalafif / fetti.coffee
Created December 18, 2019 04:02 — forked from arronhunt/fetti.coffee
Confetti module for FramerJS
colors = ["#f23f3f", "#ff7f3b", "#f2c83f", "#3ac95c", "#4a95ff", "#ac59ff", "#ff8aed", "#3bbdca"]
fetti_bag = []
exports.kaboom = () ->
unless fetti_bag.length > 1
for i in [0..100]
fetti = new Layer
width: 20, height: 20
scale: Utils.randomNumber(0.75, 1.25)
@kmelve
kmelve / Image.css
Created October 11, 2019 15:07
Lazyload Images from Sanity.io
.root {
display: block;
position: relative;
}
.lqip {
image-rendering: pixelated;
width: 100%;
opacity: 1;
transition: opacity 50ms 100ms ease-out;
@davo
davo / ScratchCard.tsx
Created August 1, 2019 23:46
ScratchCard for Framer X
// WIP Refactored from https://github.com/aleksik/react-scratchcard/
import * as React from 'react'
import { Frame, addPropertyControls, ControlType } from 'framer'
export function ScratchCard({ width, height, children, image: source, finishPercent }) {
const [loaded, setLoaded] = React.useState(false)
const [context, setContext] = React.useState(false)
const [isDrawing, setIsDrawing] = React.useState(false)
const [lastPoint, updateLastPoint] = React.useState(null)