Skip to content

Instantly share code, notes, and snippets.

View marcheidemann's full-sized avatar

js-heidemann marcheidemann

  • Hamburg London Berlin
View GitHub Profile
@marcheidemann
marcheidemann / gist:7228385
Created October 30, 2013 07:27
add function mit relation
function add() {
if ($this->request->is('post')) {
$user = $this->Auth->user();
$profile = $this->DataSet->find('first',array(
'conditions' => array(
'user_id' => $user['User']['id']
)
));
// Wenn kein DataSet => DataSet erstellen
@marcheidemann
marcheidemann / gist:7228348
Created October 30, 2013 07:22
editieren von maximal länge eines sql eintrages
ALTER TABLE users_profiles
MODIFY `uploaded_pic` varchar(100) NOT NULL DEFAULT ''
[{
"name": "Marc Heidemann",
"value": 31000,
"taxed_value": 31000 - (31000 * 0.4),
"cooler_typ": true,
"telefon": "0176 921 222 95",
"webseite": "http://microle-systems.com",
"email": "marc.heidemann@opus.edu.library.microle-systems.com"
}]
@marcheidemann
marcheidemann / gist:7150619
Created October 25, 2013 07:14
Loop für Round Floor und Ceil Präzision
(function(){
var MathFns = ['round', 'floor', 'ceil' ];
for(var i = MathFns.length; i>-1; i--)
{
Math['_' + MathFns[i]] = Math[MathFns[i]];
Math[MathFns[i]] = function(number, precision)
{
precision = Math.abs(parseInt(precision)) || 0;
var coefficient = Math.pow(10, precision);
return Math['_' + MathFns[i]](number*coefficient)/coefficient;
$('.item img').each(function() {
var lorem = $(this).attr('src');
console.log(lorem);
$(this).wrap("<a href='"+lorem+"' rel='prettyPhoto'></a>");
var ipsum = $(this).closest('a').html();
console.log(ipsum);
});
bin/solr.dev: line 3: ../var/logs/solr/solr.jetty.log: No such file or directory
20steps-MacBook-Air-2:Found mh$ mkdir -p var/logs/solr
20steps-MacBook-Air-2:Found mh$ bin/solr.dev
20steps-MacBook-Air-2:Found mh$ bin/solr.dev
sudo chmod -R 777 .
app/console assets:install
20steps-MacBook-Air-2:Found mh$ php bin/composer.phar require symfony/icu ~1.0
git clone git@git.20steps.de:twentysteps/found.git
0steps-MacBook-Air-2:Found mh$ sudo chown -R mh .
20steps-MacBook-Air-2:Found mh$ sudo mkdir -p /Projects/twentysteps/Found
20steps-MacBook-Air-2:Found mh$ app/console docinsider:process
<g:set var="show" value="hallo" />
<g:if test="${show}">
<g:javascript>
alert('hallo');
</g:javascript>
</g:if>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"><head>
<title>Jean-Remy von Matt: Er hat’s erfunden - Mein Weg - FAZ</title>
<meta name="og:title" content="Jean-Remy von Matt: Er hat’s erfunden">
<meta name="DC.date.issued" content="2012-06-07T18:20:00+0200">
<meta name="last-modified" content="2012-06-10T21:13:51+0200">
<meta http-equiv="last-modified" content="2012-06-10T21:13:51+0200">
<meta name="description" content="Er gilt als einer der kreativsten Köpfe der Werbebranche. Seine Slogans kennt jeder. Das Texten kann Jean-Remy von Matt... jetzt lesen">
<meta name="og:description" content="Er gilt als einer der kreativsten Köpfe der Werbebranche. Seine Slogans kennt jeder. Das Texten kann Jean-Remy von Matt selbst im Alter...">
<meta name="keywords" content="Jung, Holger, Matt, Jean-Remy von, Kultur, Personalie, Werbeagenturen, Deutschland">
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("body"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0);