Skip to content

Instantly share code, notes, and snippets.

@puiutucutu
puiutucutu / ImageMagick on php 5.4.9 on IIS 7.5 on Windows Server 2008 R2.md
Last active October 9, 2020 18:59
ImageMagick on php 5.4.9 on IIS 7.5 on Windows Server 2008 R2

ImageMagick on php 5.4.9 on IIS 7.5 on Windows Server 2008 R2

Stack

  • Windows Server 2008 R2 Standard Edition
    • Windows NT 6.1 (Build 7601: Service Pack 1)
  • Internet Information Services (IIS) (Version 7.5.7600.16385)
  • php 5.4.9
    • x86
  • non-thread safe
const isEveryArgumentProvided = x => y => x >= y;
function curry(f)
{
function curried(...initialArgs) {
if (initialArgs.length > f.length) {
throw new Error(
`Function \`${f.name}\` supplied ${initialArgs.length} args when expecting ${f.length} args`
);
}
@puiutucutu
puiutucutu / data.csv
Last active August 23, 2019 20:33
data.csv
group variable value
A v1 0
A v2 10.1
A v3 15.2
A v4 12.8
A v5 6.7
B v1 10.6
B v2 11.3
B v3 15.4
B v4 15.6
@puiutucutu
puiutucutu / appEntryPoint.js
Created January 29, 2018 01:43 — forked from markerikson/appEntryPoint.js
Webpack React/Redux Hot Module Reloading (HMR) example
import React from "react";
import ReactDOM from "react-dom";
import configureStore from "./store/configureStore";
const store = configureStore();
const rootEl = document.getElementById("root");
@puiutucutu
puiutucutu / Unicode table
Created January 22, 2018 05:56 — forked from ivandrofly/Unicode table
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:
@puiutucutu
puiutucutu / snippet.php
Created December 30, 2017 06:22
Ternary in php
<?php
function validateInput($input)
{
return (
! $this->is_array($input) or
! $this->someValidationMethod($input)
) ? true : false;
@puiutucutu
puiutucutu / snippet.php
Last active December 31, 2017 00:56
Export csv from buffer
<?php
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment;Filename=spreadsheet.xls");
echo 'First Name' . "\t" . 'Last Name' . "\t" . 'Phone' . "\n";
echo 'John' . "\t" . 'Doe' . "\t" . '555-5555' . "\n";
@puiutucutu
puiutucutu / snippet.php
Created December 30, 2017 05:48
PDO default settings
<?php
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_EMULATE_PREPARES => false,
];
@puiutucutu
puiutucutu / 1.php
Last active December 31, 2017 08:15
Date functions in php #datetime
<?php
// procedural
$dateDiff = date_diff(
date_create('now'),
date_create('2020-01-01')
);
$days = $dateDiff->days;
$years = $dateDiff->y;
@puiutucutu
puiutucutu / snippet.js
Last active December 29, 2017 19:02
Unique array values
const unique = dataset.filter((v, i, arr) => arr.indexOf(v) === i)