Skip to main content

Facebook == ‘The Big Brother’ ?

Facebook activated a new function… This is Tag Suggestions (auto tagging) for photos. Facebook can recognize your face when you are tagged in another photo.

If you don’t want to enable photo-tagging automatically about you (on photos of other users) search Account (top right corner) > Privacy Settings > Customize settings > Things others share >(When photos look like me, suggest my name) and disable this function.

Read More

Related Posts:

Professional backup with Git

Backup is a very-very important thing in IT. The loss of code-snippets, patch-sets, configurations or documents is very painful for programmers, system administrators and secrataries.

There are many options for this, among others hand (manually) copying. There are many applications responsible for backup on Linux, Mac or Windows. Many people use rsync as lacyc3 wrote a good post about it (in Hungarian).

Read More

Related Posts:

  • No Related Posts

A simple Sass example

Here is a Sass example. Sass is a good productivity booster or just a passing folly.

We need a border. It’s simple:

.edit_container {
  border: 1px solid #a77;
}

.editable_div {
  border: 1px solid black;
}

.gallery_preview {
  border-top: 1px solid black;
  border-bottom: 1px solid black;
}

.gallery_preview_big {
  border-bottom: 1px solid #555;
}

It’s just 4 simple class definition. Where is the DRY rule? Nowhere.

Read More

Related Posts:

prettify into Tumblr

Open your own Tumblr dashboard and here click to the Customize.
In the Theme menu click to Custom HTML… It will load code of the current template… Find the `<body>` string and replace it with this lines:

<body onload="prettyPrint()">

Then insert these lines befor `</head>`:

<link rel="stylesheet" type="text/css" href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css">
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-css.js"></script>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-sql.js"></script>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-yaml.js"></script>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-hs.js"></script>

ok… the installation is ready. (see http://google-code-prettify.googlecode.com/svn/trunk/src/ for other additional supported languages)

To modify default style click the Advanced menu and write your own style under the `Add custom CSS` label. Eg:

 

pre .str, code .str { color: #65B042 !important; }
pre .kwd, code .kwd { color: #E28964 !important; }
pre .com, code .com {
  color: #AEAEAE !important;
  font-style: italic !important;
}
pre .typ, code .typ { color: #89bdff !important; }
pre .lit, code .lit { color: #3387CC !important; }
pre .pun, code .pun { color: #fff !important; }
pre .pln, code .pln { color: #fff !important; }
pre .tag, code .tag { color: #89bdff !important; }
pre .atn, code .atn { color: #bdb76b !important; }
pre .atv, code .atv { color: #65B042 !important; }
pre .dec, code .dec { color: #3387CC !important; }

pre.prettyprint, code.prettyprint {
  background-color: #000 !important;
  -moz-border-radius: 4px !important;
  -webkit-border-radius: 4px !important;
  -o-border-radius: 4px !important;
  -ms-border-radius: 4px !important;
  -khtml-border-radius: 4px !important;
  border-radius: 4px !important;
}

pre.prettyprint {
  width: 95% !important;
  margin: 1em auto !important;
  padding: 1em !important;
  white-space: pre-wrap !important;
}

ol.linenums {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  color: #AEAEAE !important;
}
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 {
  list-style-type: none !important
}
li.L1,li.L3,li.L5,li.L7,li.L9 { } 

pre { padding: 5px; font-size: 1em !important; }

hr {
  border: none;
  border-top: 1px dotted #AA2200;
  width: 80%;
  margin-left: 0;
}

Now if you want insert any code snippet into your post you need to edit as HTML (right side of the editor icon set) and put it into a `pre` tag (or `code`). Eg:

<pre class="prettyprint lang-php">
  <!--?php echo 'Test' ?-->
</pre>

Where lang-XXX is the language what you want to use.

If you have any questions feel free to ask.

Related Posts:

Re: JDN 2/11: The UK Approach to Unmanned Aircraft Systems

Lawyer: Admit that the above can be seen of code you wrote?
Programmer: Yes.
Lawyer: Admit that this code is buggy?
Programmer: No.
Lawyer: But it’s visible that certain input values ​​pass control to the wrong place. So I ask again, admit mistakenness of the code?
Programmer: No… because under normal use this code is flawless.
Lawyer: What do you mean ‘normal use’?
Programmer: Let’s just say that not killing people.

Related Posts:

  • No Related Posts

Notice: Can I create `New` function in a class in PHP?

class wsGallery extends wsCore {
  const _PRIVATE = 1;
  const _PUBLIC  = 2;
  const _HIDDEN  = 3;
  const _SYSTEM  = 4;
  const _PROFILE = 5;

  private function __construct($gid) {
    parent::__construct();
    $this->gallery = wsCache::galleries()->findOne(array(
      '_id' => new MongoId($gid)
    ));
    $this->full_images = wsCache::images()->find(
      array('gallery_id' => $gid)
    );
  }
  static function new($name, $type) {
    $gallery = array(
      'name'     => $name,
      '_type'    => $type,
      'owner_id' => USER_ID,
      'images'   => array(),
      'requests' => array(),
      'accepted' => array()
    );
    wsCache::galleries()->insert($gallery);

    return new self($gallery['_id']);

  }
}

wsGallery::new('My gallery', wsGallery::_PRIVATE);

If you want to do this (or similar)… Forget the `new` keyword:

class wsGallery extends wsCore {
  const _PRIVATE = 1;
  const _PUBLIC  = 2;
  const _HIDDEN  = 3;
  const _SYSTEM  = 4;
  const _PROFILE = 5;

  private function __construct($gid) {
    parent::__construct();
    $this->gallery = wsCache::galleries()->findOne(array(
      '_id' => new MongoId($gid)
    ));
    $this->full_images = wsCache::images()->find(
      array('gallery_id' => $gid)
    );
  }
  static function create($name, $type) {
    $gallery = array(
      'name'     => $name,
      '_type'    => $type,
      'owner_id' => USER_ID,
      'images'   => array(),
      'requests' => array(),
      'accepted' => array()
    );
    wsCache::galleries()->insert($gallery);

    return new self($gallery['_id']);
  }
}

wsGallery::create('My gallery', wsGallery::_PRIVATE);

It’s another stupidity of PHP… the new keyword is reserved for instances [eg: new wsGallery()] But why? The parser can’t understand the Regular Expressions? `new Classname()` is not equal with `Classname::new()`.

The first is:
/\bnew\b [a-zA-Z_][a-zA-Z0-9_]*/

and the second is:
/\b[a-zA-Z_][a-zA-Z0-9_]*::[a-zA-Z_][a-zA-Z0-9_]*/

(or similar but the formats aren’t the same… Really not)

Related Posts: