Skip to content

Instantly share code, notes, and snippets.

View mokargas's full-sized avatar
🏠
Working from home

Mo mokargas

🏠
Working from home
View GitHub Profile
@chriseppstein
chriseppstein / filters.sass
Created June 6, 2012 20:40 — forked from DeviaVir/filters.sass
Filters SASS
@mixin filter( $var )
-webkit-filter: $var
-moz-filter: $var
-ms-filter: $var
-o-filter: $var
filter: $var
a
&.on
@include filter( sepia(100%) hue-rotate(33deg) contrast(69%) unquote("saturate(2)"))
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active July 28, 2024 05:15
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@krisbulman
krisbulman / countCSSRules.js
Last active August 25, 2022 19:53 — forked from psebborn/countCSSRules.js
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE. — This snippet has been modified to count more than just the first level of CSSStyleRule objects within CSSMediaRule.
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active May 11, 2024 17:43
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@lmccart
lmccart / gist:2273a047874939ad8ad1
Last active February 18, 2024 21:57
p5.js + p5.dom.js + clmtracker.js
<html>
<head>
<script src="clmtrackr.js"></script>
<script src="model_pca_20_svm.js"></script>
<script src="p5.js"></script>
<script src="p5.dom.js"></script>
<script>
var ctracker;
@AllThingsSmitty
AllThingsSmitty / apple-mq.css
Last active June 23, 2022 19:56
iPhone 6/6 Plus and Apple Watch CSS media queries
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@AdaRoseCannon
AdaRoseCannon / equirectangular.js
Last active June 1, 2022 19:33
Run this on an AFRAME scene to export it as an equirectangular image.
/* eslint no-var:0 */
/* global AFRAME */
'use strict';
// Now out of date, use:
AFRAME.scenes[0].components.screenshot.capture()
// OLD METHOD BELOW:
@mynameislau
mynameislau / occlu.component.js
Last active May 12, 2023 17:00
Ambient occlusion component for AFRAME
// All three js imports can be found in the threejs github repository
import '../three/shaders/CopyShader';
import '../three/postprocessing/Effectcomposer';
import '../three/shaders/SSAOShader';
import '../three/postprocessing/RenderPass';
import '../three/postprocessing/ShaderPass';
const {
MeshDepthMaterial,
Clock,
@tiffwu
tiffwu / react-form-with-react-select.jsx
Created November 20, 2017 21:40
react-form wrapper for async react-select component
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { FormField } from 'react-form';
import Select from 'react-select';
import 'react-select/dist/react-select.css';
// WIP custom message component
const Message = ({ color, message }) => (
<div style={{ color }}>
<small>{JSON.stringify(message)}</small>