Skip to content

Instantly share code, notes, and snippets.

View thierryc's full-sized avatar

Thierry Charbonnel thierryc

View GitHub Profile
@rauchg
rauchg / p.sh
Last active March 12, 2024 04:28
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
import SwiftUI
import PlaygroundSupport
// constants
let cardWidth: CGFloat = 343
let cardHeight: CGFloat = 212
let spacing = 36
let animation = Animation.spring()
let cardColors = [
Color(UIColor.systemRed),
<script>
import { Color, Slider, Props } from "txl";
export let inner = 0.5;
export let outer = 0.75;
export let vertices = 10;
function enter ({ context, width, height }) {
const cx = width / 2;
const cy = height / 2;
<script>
import LinearGradient from '@mattdesl/components/LinearGradient.txl';
import NoiseLines from '@mattdesl/components/NoiseLines.txl';
</script>
<LinearGradient />
<NoiseLines />
@mathieudutour
mathieudutour / sRGB-blur.js
Last active July 22, 2020 16:34
SVGO plugin to fix color space issue in Safari on SVG Filter primitives
'use strict';
exports.type = 'perItem';
exports.active = true;
exports.description = 'add color-interpolation-filters="sRGB" to filters';
exports.params = {
force: false,
@MrToph
MrToph / Axis.js
Created June 21, 2017 21:16
Charts in React Native with React-Native-SVG and D3.js
import React, { Component, PropTypes } from 'react'
import { G, Line, Path, Rect, Text } from 'react-native-svg'
import * as d3scale from 'd3-scale'
import { dateToShortString } from '../utils'
export default class Axis extends Component {
static propTypes = {
width: PropTypes.number.isRequired,
ticks: PropTypes.number.isRequired,
x: PropTypes.number,
import React, { Component, PropTypes } from 'react'
import { G, Line, Text } from 'react-native-svg'
import * as d3scale from 'd3-scale'
export default class Axis extends Component {
static propTypes = {
width: PropTypes.number.isRequired,
ticks: PropTypes.number.isRequired,
x: PropTypes.number,
y: PropTypes.number,
@vvo
vvo / Algolia + React.markdown
Created July 21, 2016 07:37
Algolia + React
@tinovyatkin
tinovyatkin / loadFont.js
Last active November 17, 2022 23:09
My function to async load web fonts (real WOFF and WOFF2, not base64 behemots), cache them to localStorage and reuse on next visits
/**
* This function load font from web, stores it in localStorage and reuses on next page loads
* Different to everything I found on the internet due to following facts
* 1. Checks if the font is installed in the system and spend no time if it is
* 2. Loads actual WOFF or WOFF2 fonts (if supported) and not bit base64 encoded version - so it faster
* 3. Uses fetch API and FontFace API if available - it's cool!
* 4. Return promises and uses jQuery for cases where native promises probably not available
*
* @param fontName (Field for font-face)
* @param fontUrl (full URL but without .woff nor .woff2 extensions - format will be selected automatically)
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a