Skip to content

Instantly share code, notes, and snippets.

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

Pascal Brewing DrMabuse23

🏠
Working from home
View GitHub Profile
@DrMabuse23
DrMabuse23 / input.scss
Created February 17, 2021 12:32
Generated by SassMeister.com.
$dsp-md-imprint: "e900";
@function unicode($str){
@return unquote("\"")+unquote(str-insert($str, "\\", 1))+unquote("\"")
}
@mixin makeIcon($arg, $val , $os: null) {
// @debug $os;
// @debug $arg;
// @debug $val;
@DrMabuse23
DrMabuse23 / carousel.ts
Created January 28, 2020 14:41
Carousel rxjs
@DrMabuse23
DrMabuse23 / SassMeister-input.scss
Last active April 4, 2018 13:56
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (vundefined)
// ----
%button{
background-color: lightgrey;
&:hover, &:active{
background-color: white
}
https://gist.github.com/DrMabuse23/bd27dd1c7b845d41fd16aa5e68665e0a
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {
return $text;
}
// splits all html-tags to scanable lines
preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);
$total_length = strlen($ending);
$open_tags = array();
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(home: new ChartPage()));
}
class ChartPage extends StatefulWidget {
@override
batchInserts(table : string, fields : Array < string >, rows : Array < any >, chunkSize = 200) {
if (!table || !table.length) {
return Observable.throw(`table on batchinsert is required`);
}
if (!rows || !rows.length) {
return Observable.throw(`rows can not be empty on batchinsert`);
}
let inserted = 0;
return Observable
import { Events } from 'ionic-angular';
import { Output, EventEmitter } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/Rx';
/**
*
* @example {"artist":{"name":"The Pandoras"},"album":"Stop Pretending","rating":0,"ownerShip":"Vinyl","tags":""}
* @export
const fake = () => {
let _data = [];
for (i = 0, l = 46; i < l; i++) {
let card = faker.helpers.userCard();
card.id = (i + 1);
_data.push(card);
}
return _data;
}