Skip to content

Instantly share code, notes, and snippets.

View khepin's full-sized avatar

Sebastien Armand khepin

  • San Francisco, USA
View GitHub Profile
@khepin
khepin / EasterEgg.js
Last active December 13, 2015 21:18
EasterEgg.js
function EasterEgg(egg, cb) {
this.egg = egg;
this.cb = cb;
this.start();
}
EasterEgg.prototype.start = function() {
var egg = this.egg;
var buffer = [];
var cb = this.cb;
describe(['class_to_be_tested'], function(my_class){
// Jasmine code
});
@khepin
khepin / robot.js
Created December 7, 2012 03:10 — forked from f6p/robot.js
NecroBadger
// helpers
function areEnemies(robot, sighted) {
var sightedIsChild = (robot.id == sighted.parentId);
var sightedIsParent = (robot.parentId == sighted.id);
return !(sightedIsChild || sightedIsParent);
};
function baseStep(robot) {
<div class="field">
<% if(field.toolTip !== undefined) { %>
<%= _.partial('tooltip', {tooltip: {content: field.toolTip}}) %>
<% } %>
</div>
_.declarePartial('tooltip', '<div class="toolTipWrapper"><div class="trigger"><i></i></div><div class="content"><%= tooltip.content %></div></div>');
/**
* Allow underscore use of partials
*/
var underscorePartials = (function(){
var partialCache = {};
var mixin = {
declarePartial: function(name, template) {
partialCache[name] = _.template(template);
},
@khepin
khepin / capture.sh
Last active October 12, 2015 16:18
TimelapseVideo
#!/bin/bash
killall gvfs-gphoto2-volume-monitor
killall gvfsd-gphoto2
cd /home/seb/Desktop/tltest
echo "taking a pic" >> counter
/usr/bin/gphoto2 --capture-image-and-download --interval 600 --frames 20
<?php
namespace Acme\MessageBundle\FormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Security\Core\SecurityContext;
use Doctrine\ODM\MongoDB\DocumentRepository;
class FriendMessageWithAttachmentFormType extends AbstractType
<div id="first-tab">
<form action="{{ path('mashup_user_profile_update') }}" method="post" {{ form_enctype(form) }} class="form-horizontal span6">
{{ form_row(form.first_name) }}
{{form_rest(form)}}
<div class="form-actions">
<button type="submit" class="btn btn-primary">Update my profile</button>
</div>
</form>
<?php
namespace Acme\MessageBundle\FormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Security\Core\SecurityContext;
use Doctrine\ODM\MongoDB\DocumentRepository;
class FriendMessageFormType extends AbstractType