Skip to content

Instantly share code, notes, and snippets.

View kevyworks's full-sized avatar

Kevyworks kevyworks

View GitHub Profile
@media screen and (-webkit-min-device-pixel-ratio:0) {
/* CSS Statements that only apply on webkit-based browsers (Chrome, Safari, etc.) */
body { background:red; }
}
var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
var http = require('http'),
fs = require('fs'),
path = require('path'),
exec = require('child_process').exec;
function pipeDoc(inputPath, finalType, stream) {
var finalPath = path.dirname(inputPath)
+ "/" + path.basename(inputPath).split('.')[0] + ".html";
var convCommand = 'unoconv -f ' + finalType + " " + inputPath;
exec(convCommand,function(err, stdout, stderr) {
  1. You have Ghostscript installed, right? Otherwise sudo apt-get install ghostscript
  2. This is important and installs the headers (iapi.h etc) which are required but don't come with the default Ghostscript package: sudo apt-get install libgs-dev
  3. I also needed sudo apt-get install gs-esp
  4. For me the pre compiled version of ImageMagick never accepted Ghostscript, so let's remove it: sudo apt-get --purge remove imagemagick
  5. Get the source of ImageMagick, untar it, cd ImageMagick-xx
  6. ./configure --with-gslib=yes [and what else you need]
  7. Confirm in the output near the bottom gslib yes yes and not gslib yes no
  8. make
  9. make install
  10. Run convert -list configure | grep DELEGATES => DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
<?php
$data = (object)array(
"html" => "<foo bar=\"baz\"/> &amp;",
"arabic" => "العربية al-ʿarabiyyah, IPA: [æl ʕɑrɑˈbijjɐ], or عربي ʿarabī",
"hebrew" => "עִבְרִית, Ivrit",
"chinese" => "汉语/漢語 Hanyu; 华语/華語 Huáyǔ; 中文 Zhōngwén",
"korean" => "한국어/조선말",
"japanese" => "日本語 Nihongo",
"umlauts" => "äüöãáàß",

Install web development tools to Mavericks (OS X 10.9)

Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.

I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).

These are my opinions. Read this document through and pick up the good parts to your preferences.

System preferences

Normalize $_FILES array when uploading multiple files

When uploading multiple files, the $_FILES variable is created in the form:

Array
(
    [name] => Array
        (
            [0] => foo.txt
@kevyworks
kevyworks / currency-symbols.xml
Created October 1, 2015 02:38 — forked from bzerangue/currency-symbols.xml
World currencies with their symbols
<?xml version="1.0" encoding="UTF-8"?>
<!--
## SOURCE: xe.com
-->
<currency-symbol count="115">
<entry code="ALL" unicode-decimal="76, 101, 107" unicode-hex="4c, 65, 6b">Albania Lek</entry>
<entry code="AFN" unicode-decimal="1547" unicode-hex="60b">Afghanistan Afghani</entry>
<entry code="ARS" unicode-decimal="36" unicode-hex="24">Argentina Peso</entry>
<entry code="AWG" unicode-decimal="402" unicode-hex="192">Aruba Guilder</entry>
<entry code="AUD" unicode-decimal="36" unicode-hex="24">Australia Dollar</entry>
@kevyworks
kevyworks / DotNotation.php
Created February 2, 2016 07:03 — forked from antonmedv/DotNotation.php
Dot notation for access multidimensional arrays.
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*
@kevyworks
kevyworks / scotchboxphp7.txt
Created November 15, 2016 15:16 — forked from mizner/scotchboxphp7.txt
Scotchbox PHP 7
List of PHP 7 Packages: https://launchpad.net/ubuntu/+source/php7.0
Disclaimer: I get unreliable results when I don't run these commands seperately and in order.
vagrant ssh
sudo apt-get update
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
sudo apt-get update