Skip to content

Instantly share code, notes, and snippets.

View nervetattoo's full-sized avatar

Raymond Julin nervetattoo

View GitHub Profile
@nervetattoo
nervetattoo / html
Created March 13, 2015 09:51
booster-bem
<section class="feed">
<div class="feed__item">
<div class="feed__item__image">
<img src="https://pbs.twimg.com/profile_images/378800000703912809/95cb11a8f7c2832b5de07055e3ff66b2.png">
</div>
<div class="feed__item__content">
<h2>Marius Hauken</h2>
<p>Naming CSS-classes sucks, but it's worth doing properly and think a lot about!</p>
</div>
<time class="feed__item__desc">03.03</time>
@nervetattoo
nervetattoo / the-designer-is-dead-long-live-design
Last active August 29, 2015 14:21
The designer is dead, long live design
# The designer is dead, long live design
Design is a hotter subject than ever before. Apple is the most successful company in history, fueled by design, and the subsequent "design thinking" philosophy.
The concept of "design" is a far too important thing to be left to a designer. The designer is dead.
Long live design.
Design is a misunderstood practice, and one that I misunderstood for a long time myself. Being a developer – in itself a misunderstood practice for most as well – I long thought that we needed designers to design the stuff we were building. I expected upon the poor designers to produce blueprints for what we were building.
We often see clients reach out to us to buy a UX revamp, or some design touches, on their applications, websites or other visual properties.
Many think that the visual expression designed by the previous designer 5 years back is a replaceable skin with few ties into the application, or anything deeper.
@nervetattoo
nervetattoo / promiseGate.js
Created June 9, 2015 11:38
Naming things?
function promiseGate(test) {
return function promiseGateResolver(value) {
return test(value).then(function(passedTest) {
if (!passedTest) throw new Error(test.name + ' failed');
return value;
})
}
};
function checkLength(file) {
.jg .image img {
border: 1px solid silver;
padding: 4px;
width: 300px;
height: 300px;
}
.jg li {
opacity: .7;
border: 1px solid #999;
float: left;
We couldn’t find that file to show.
git stash; git checkout master; git pull; git checkout search; git merge master; git stash apply
<?php
$transport = new ElasticSearchTransportHTTP("localhost", 9200);
$search = new ElasticSearchClient($transport, "1311", "affiliates");
$query = array(
'query' => array(
'bool' => array(
'must' => array(
array(
'query_string' => array(
@nervetattoo
nervetattoo / Photo.php
Created November 1, 2010 20:26
Initial image handler route
<?php
class Photo extends \lithium\data\Model {
/**
* Generate a cached version under webroot
* @param string $id The image id as in mongodb
* @param array $options Possible values are
* width
<?php
Validator::add('array', function(&$value, $format = null, array $options = array()) {
$options += array(
'threshold' => 0,
'validator' => 'notEmpty'
);
if (is_array($value)) {
$failed = 0;
$valueCount = count($value);
foreach ($value as $item) {
convert image.jpg profile.icc
convert image.jpg -profile profile.icc -profile /path/to/sRGB_IEC61966-2-1_black_scaled.icc -trim working-image.jpg