Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am schubidu on github.
  • I am schubidu (https://keybase.io/schubidu) on keybase.
  • I have a public key ASCjVibhaINA3Rosnwa3rBUyTezfGgMeVV2I1ljeN5C_9Ao

To claim this, I am signing this object:

@Schubidu
Schubidu / testSnapshot.js
Last active January 9, 2017 08:23
jest snapshot snippet
// npm install --save-dev react-test-renderer
import React from 'react';
import renderer from 'react-test-renderer';
export default (component) => {
const tree = renderer.create(
component
).toJSON();
expect(tree).toMatchSnapshot();
}
@Schubidu
Schubidu / testSnapshot.js
Created January 9, 2017 08:19
jest snapshot snippet
import React from 'react';
import renderer from 'react-test-renderer';
export default (component) => {
const tree = renderer.create(
component
).toJSON();
expect(tree).toMatchSnapshot();
}
@Schubidu
Schubidu / participants_faker.js
Created February 24, 2016 08:36
generates participants
var faker = require('faker');
var Chance = require('chance');
var fs = require('fs');
var chance = new Chance();
var max = 28;
var participants = [];
var i = 0;
for (i; i < max; i++) {
@Schubidu
Schubidu / build-css.js
Last active August 29, 2015 14:04
gulp task to build css from ruby sass, minfied and with base64-data-images
// install gulp depencies
// npm install -D gulp gulp-ruby-sass gulp-autoprefixer gulp-connect gulp-connect gulp-rename gulp-minify-css gulp-filesize gulp-filter gulp-base64 gulp-notify
// Set source and destination directory
var config = {
src: './app/scss/**/*.scss',
dest: './app/css'
}
// watch with gulp css:watch
@Schubidu
Schubidu / SassMeister-input-HTML.html
Created April 2, 2014 08:49
Generated by SassMeister.com.
<div class="tilesCollection">
<div class="tiles" id="t1">A</div>
<div class="tiles" id="t2">B</div>
<div class="tiles" id="t3">C</div>
<div class="tiles" id="t4">D</div>
<div class="tiles" id="t5">E</div>
<div class="tiles" id="t6">F</div>
</div>
@Schubidu
Schubidu / 0_reuse_code.js
Created December 24, 2013 12:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// names and colors from http://flatuicolors.com/
$turquoise: #1ABC9C;
$green-sea: #16A085;
$emerland: #2ECC71;
$nephritis: #27AE60;
$peter-river: #3498DB;
$belize-hole: #2980B9;
$amethyst: #9B59B6;
$wisteria: #8E44AD;
@Schubidu
Schubidu / _pages.php
Created October 17, 2012 06:57
list all html-files in current directory
<?php
foreach(glob("*.html") as $page){
echo '<li><a href="' . $page . '">' . $page . '</a></li>';
}
@Schubidu
Schubidu / prototypejs-maxlength.js
Created May 26, 2012 13:46
supports maxLength-limitations to textarea in prototypejs
Element.addMethods(["textarea"], {
/**
* @description supports maxLength-limitations to textarea;
* @param element
* @param max charset length in field
* @param handler a handler-function which have the current left charset value in parameter
*/
maxTextLength: function(element, max, handler){
element = $(element);
handler = (handler == undefined) ? function(){} : handler;