Skip to content

Instantly share code, notes, and snippets.

//
// **** Kitchen Sink Tests ****
//
// This app was developed to demonstrate
// how to write tests in Cypress utilizing
// all of the available commands
//
// Feel free to modify this spec in your
// own application as a jumping off point
/**
* @fileoverview Runs `prettier` as an ESLint rule.
* @author Andres Suarez
*/
'use strict';
// ------------------------------------------------------------------------------
// Requirements
// ------------------------------------------------------------------------------
@jakub300
jakub300 / packages.json
Last active October 17, 2016 14:59
Composer repository
{
"packages": {
"wp-premium/gravityforms": {
"dev-master": {
"name": "wp-premium/gravityforms",
"version": "dev-master",
"type": "wordpress-plugin",
"source": {
"url": "https://github.com/wp-premium/gravityforms.git",
"type": "git",
@jakub300
jakub300 / run.sh
Last active January 9, 2022 01:48
Compile headless shell (Chromium)
# Based on:
# https://web.archive.org/web/20200212121848/http://www.zackarychapple.guru/chrome/2016/08/24/chrome-headless.html
# https://www.chromium.org/developers/how-tos/get-the-code
# https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
apt-get update
apt-get install -y curl git htop man unzip vim wget python
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:`pwd`/depot_tools
mkdir Chromium && cd Chromium
import java.io.Console;
public class ConsoleHelper {
static Console console = System.console();
public static int askQuestion(String question, String... answers) {
System.out.println(question);
for (int i = 0; i < answers.length; i++) {
System.out.println("\t "+(i+1)+". "+answers[i]);
}
while(true) {
@jakub300
jakub300 / convert.js
Created October 23, 2015 17:29
Podstawy baz danych convert
var cornersY = [779, 2606, 4433],
cornerX = 546,
size = [2394-546, 2166-779]; //x, y
var fs = require('fs'),
path = require('path');
Canvas = require('canvas'),
Image = Canvas.Image,
spawnSync = require('child_process').spawnSync;
@jakub300
jakub300 / aaa.md
Created May 25, 2012 14:57
gm vs canvas przy generowaniu miniaturek

Na wstępie:

  • gm spawnuje procesy więc wykorzystuje wszystkie rdzenie (w teście 4)
  • canvas działa jako biblioteka node więc tylko w procesie node (tylko 1 rdzeń)
  • lepiej dostarczać node-canvas odczytany plik (buffer) niż nazwę pliku
  • zużycie RAMu prze node-canvas nie przekraczało 300 MB (nawet przy -c 500)

node-canvas miażdży gm :)

https://github.com/LearnBoost/node-canvas

blip@WTW RegExps

Avatar autora blipnięcia

RegExp:

^<a [a-z0-9=:/\._"]* href="http://blip.pl/users/([a-z0-9]*)/dashboard" [a-z0-9=:/\._"]*>[a-z0-9]*</a>

Format:

<a href="http://blip.pl/users/$1/dashboard"><img border="0" src="http://blip.pl/users/$1/avatar/femto.jpg" title="$1" />$1</a>