Skip to content

Instantly share code, notes, and snippets.

View andreiglingeanu's full-sized avatar

Andrei Glingeanu andreiglingeanu

View GitHub Profile
jQuery('table.fullWidth > tbody > tr') // selectăm rîndurile din tabel
.slice(1) // primul nu ne interesează, în el se conține titlul la tabel
.filter(function(){ // filtrăm setul primit de rînduri ca să rămînem doar cu rîndurile ce nu au mesaje noi
// imaginea roșie se numește unlockednew.gif, cea albastră - unlocked.gif
// se poate și așa: return jQuery(this).find('img')[0].src.match(/unlocked.gif$/));
return ! (jQuery(this).find('img')[0].src.match(/new.gif$/));
}).remove(); // ștergem rîndurile ce nu au mesaje noi
let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
\ --ignore .git
\ --ignore .svn
\ --ignore .hg
\ --ignore .DS_Store
\ --ignore "**/*.pyc"
\ -g ""'
@import url('http://fonts.googleapis.com/css?family=[h1_font_family]');
body.ct-boxed {
background-color: [boxed_container_bg] !important;
}
@media (min-width: [site_width]px) {
body.ct-boxed .ct-header,
body.ct-boxed .ct-content-wrapper {
width: [site_width]px !important;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCW5udpYbZxAp4DqJsB6Od9uxxS1zClw+bBkYM/1e92sQmhjcdMpTgeNkAaE5DGrCdHPG/RiVX6fmHdQG3Q5usMqxXCnJbKJNHzKMqEV+tOV8nL5BObKN4xrScg8n3kD7QbQOlhZG0fpR25u/S+XSP9QGv2oekoXG9tMp1GMrf8cXucSkP6mkoucNfowHvAGYibKff+y5iq92n+Hk/ncC9wsNIeAll2GXclxZfymZL053euk8161K+zNGbkHJS11rAG7csOqpnEPPiDO/Z25dwmnwAZBW9RavPj/3DEOxXYxhPjj16TRCEM8Kj59CWnNQdu4FaqWbh+E6cMyDBfwWtp andrei@apples-MacBook-Air.local
module ApplicationHelper
# a helper to get a data uri for an image asset
# e.g. <img src="<%= asset_data_uri('facebook.png') %>" />
def asset_data_uri(path)
asset = asset_paths.asset_for path, nil
base64 = Base64.encode64(asset.to_s).gsub(/\s+/, "")
"data:#{asset.content_type};base64,#{Rack::Utils.escape(base64)}"
end
end

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@andreiglingeanu
andreiglingeanu / example.php
Created March 30, 2016 22:11 — forked from jdp/example.php
Partial function application with PHP
<?php
function foo($a, $b) {
echo "a: {$a} b: {$b}\n";
}
$foo_caller = new PartialCallable('foo', array('A'));
$foo_caller('B');
$foo_caller = partial_function('foo', 'A');
$foo_caller('B');
@andreiglingeanu
andreiglingeanu / LICENSE
Created April 6, 2016 14:34 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@andreiglingeanu
andreiglingeanu / Fresh-Install.markdown
Created May 3, 2016 15:20 — forked from ericboehs/Fresh-Install.markdown
What I do after a fresh install of Mac OS X