Skip to content

Instantly share code, notes, and snippets.

@tsi
tsi / input.scss
Created September 19, 2022 14:12
Generated by SassMeister.com.
$text-color: #0c163b;
@function HEX2RGB($hex) {
@return #{red($hex)},#{green($hex)},#{blue($hex)};
}
.a {
color: HEX2RGB($text-color);
}
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4420.0 Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36",
"benchmarkIndex": 1585.5,
"credits": {
"axe-core": "4.2.3"
}
},
@tsi
tsi / Map.js
Created August 8, 2016 14:52
Simplest open-layers ReactJS component basic example
import React, { Component } from 'react';
require('ol3-google-maps');
require('openlayers/css/ol.css');
require('./Map.scss');
export default class Map extends Component {
componentDidMount() {
Settings
@tsi
tsi / _ir.scss
Created February 21, 2016 09:00
// ----------------------------------------------
// Image Replacement
// ----------------------------------------------
@mixin ir($img, $width: image-width($img), $height: image-height($img), $x: 50%, $y: 50%) {
background: {
image: image-url($img);
repeat: no-repeat;
position: $x $y;
};
@tsi
tsi / dpm_list.php
Created October 29, 2014 14:41
dpm_list()
<?php
function dpm_list($group) {
dpm(array_keys((array) $group));
}
@tsi
tsi / _layout.scss
Last active August 29, 2015 14:04
My layout helper scss partial
// ----------------------------------------------
// Layout
// ----------------------------------------------
// Settings
$container: 960px !default;
$flow: left !default;
$opos: if($flow == left, right, left);
@tsi
tsi / layout-mixin.scss
Last active August 29, 2015 14:01
Salsa style, simplifyed layout mixin.
/////////////////////////////////////////////////
//// Salsa style layout mixin. Simplified. ////
/////////////////////////////////////////////////
// See usage examples below.
$flow: left !default;
$opos: if($flow == left, right, left);
// Compass is needed only for the box-sizing() mixin.
@tsi
tsi / lipsum.js
Last active July 4, 2022 09:19
Lorem ipsum generator bookmarklet
javascript: (function () {
function createLipsum() {
var p = document.createElement("textarea");
p.appendChild(
document.createTextNode(
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet."
)
);
p.setAttribute(
"style",
@tsi
tsi / imgProxy.js
Last active August 29, 2015 13:56
This script checks for images load errors and try to load the image from a fallback provided server name.
/**
* This script checks for image load errors.
* It will try to load the image from a fallback provided server name.
*
* Usage:
*
* - Include it:
* <script src="/js/imgProxy.js"></script>
*
* - Call it from your script (or un-comment the call below):