Skip to content

Instantly share code, notes, and snippets.

View flunder's full-sized avatar

Lars flunder

  • LarsAttacks
  • London
View GitHub Profile
@bobspace
bobspace / css_colors.js
Last active June 24, 2024 13:46
All of the CSS Color names in a big javascript object.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript object containing all of the color names listed in the CSS Spec.
// This used to be a big array, but the hex values are useful too, so now it's an object.
// If you need the names as an array use Object.keys, but you already knew that!
//
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
@jsdf
jsdf / ReactNativeHTML.js
Last active July 11, 2024 00:06
Rendering HTML rich text as React Native <Text> elements
var React = require('react-native')
var {
View,
Text,
LinkingIOS,
StyleSheet,
} = React
// you might want to compile these two as standalone umd bundles
// using `browserify --standalone` and `derequire`
@mattclements
mattclements / function.php
Last active July 2, 2024 15:32
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@delfrrr
delfrrr / background.js
Created January 31, 2017 08:34
react-native requestAnimationFrame and d3-interpolate
//this is an example of background animation from my weather comparsion app
//you can get early build of app at http://zowni.com
//full source of background.js below
const React = require('react');
const Svg = React.createFactory(require('react-native-svg').Svg);
const {interpolate} = require('d3-interpolate');
//...
/**
@mfd
mfd / GTWalsheimPro.css
Last active May 3, 2024 16:52
GT Walsheim Pro
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Regular"),local("GTWalsheimProRegular"),url(GTWalsheimProRegular.woff2) format("woff2"),url(GTWalsheimProRegular.woff) format("woff"),url(GTWalsheimProRegular.ttf) format("truetype");
font-weight: 400;
font-style: normal
}
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Bold"),local("GTWalsheimProBold"),url(GTWalsheimProBold.woff2) format("woff2"),url(GTWalsheimProBold.woff) format("woff"),url(GTWalsheimProBold.ttf) format("truetype");
@kmagiera
kmagiera / reanimated.js
Created March 7, 2018 13:37
Snappable component sample implementation based on new Animated API
import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';
import { PanGestureHandler, State } from 'react-native-gesture-handler';
import Animated from 'react-native-reanimated';
class Snappable extends Component {
constructor(props) {
super(props);
@nathaniel-miller
nathaniel-miller / linting.md
Created July 7, 2019 03:17
VSCode, ESLint, Prettier, Husky Setup

This is a giant pain in the ass to get working correctly and consistently. Even when it does work, often trying to replicate it in another repository or workspace the setting's don't always seem to work.

I can at times entirely remove my .eslintrcand vscode will still go on its merry way, linting from some mysterious ghost rules. On other occasions things will be great and then, after restarting vscode, I'll be told my imports are invalid (they are not).

As a matter of fact, as I sat down to write this I couldn't get it to linting/format according to my rules. Eventually I reinstalled my node packages with npm install and tried to commit a poorly formatted file (which thankfully failed). That seemed to finally kick something (not sure what) in the pants and linting began to function correctly. But literally, I've spent days getting this sorted out.

Anyway, here's my current setup.

VSCODE SETTINGS

In either ~/.config/Code/User/settings.json or myworkspace.code-workspace:

@aolufisayo
aolufisayo / rn_gesture.js
Created August 5, 2019 12:03
React Native Gesture Blurview Drawer
// This SNACK is a follow up of this tweet:
// https://twitter.com/MengTo/status/1142539362875392001
// I just wanted to recreate it using React Native ❤️
// Take the code as it is, I'll not refactor it -> unnecessary effort
import React, { Component } from 'react';
import {
TouchableOpacity,
StatusBar,
Text,
ImageBackground,
@pedroraft
pedroraft / ZoomableImage.tsx
Last active March 7, 2020 20:17
ZoomableImage
import React from 'react'
import { Animated, Image, StyleSheet, ImageSourcePropType } from 'react-native'
import {
PinchGestureHandler,
PinchGestureHandlerStateChangeEvent,
State,
} from 'react-native-gesture-handler'
import { Container } from '../ui'
import Colors from '../../constants/Colors'
@aranda-adapptor
aranda-adapptor / App.tsx
Last active April 24, 2023 10:27
Starfield in Reanimated 2 - adding animation 1
import React, { useEffect } from "react";
import { View } from "react-native";
// Import the required types from Reanimated
import Animated, {
Easing,
useAnimatedStyle,
useSharedValue,
withRepeat,
withTiming,
} from "react-native-reanimated";