Skip to content

Instantly share code, notes, and snippets.

View sinsunsan's full-sized avatar

Sébastien LUCAS sinsunsan

View GitHub Profile
@sinsunsan
sinsunsan / SassMeister-input-HTML.html
Created March 28, 2014 14:48
Generated by SassMeister.com.
<div class="container">
<div class="rectangle wrap-image"></div>
<div class="rectangle wrap-image">
<img src="http://placekitten.com/g/700/500" />
</div>
</div>
@sinsunsan
sinsunsan / check-nested
Created July 17, 2014 09:39
Check nested : detect the existence of the sublevel of an object
// http://stackoverflow.com/questions/2631001/javascript-test-for-existence-of-nested-object-key
function checkNested(obj /*, level1, level2, ... levelN*/) {
var args = Array.prototype.slice.call(arguments),
obj = args.shift();
for (var i = 0; i < args.length; i++) {
if (!obj || !obj.hasOwnProperty(args[i])) {
return false;
}
Verifying that +slucas is my openname (Bitcoin username). https://onename.io/slucas
- var list = {class:"testClass", ngModel:"testNgModel", item: "testItem", value: "testValue"}
mixin recursivList(list)
ul(class='#{list.class}')
li(ng-repeat='#{list.item} in #{list.ngModel}') {{ #{list.value} }}
block
mixin recursivList1(list)
ul(class='#{list.class}')
li(ng-repeat='#{list.item} in #{list.ngModel}', ng-bind=list.value)
block
//- Ton yaml
newField:
id: "newField"
type: "text"
label: "Enter something"
required: false
//- ici tu as le système de mixins par type de champs
//- mais c'est un peu redondant et en plus pas possible
li(ng-repeat='item in #{list.ngRepeatItems}')
- if (list.uiSref) {
a(ui-sref=list.uiSref)
- }
span(
tooltip-placement=list.tooltip.position,
tooltip=list.tooltip.value,
ng-bind=ngBind)=ngRepeatValue
var hasRoleInCircle = function(circle, member) {
circle = circle || ScopeService.getCurrentCircle();
member = member || ScopeService.getMemberCur();
if( !circle || !member){
return false;
}
@sinsunsan
sinsunsan / md
Last active September 8, 2015 07:45
# Necessary packages
"grunt": "^0.4.5",
"grunt-bower-install-simple": "^0.9.3",
"grunt-bump": "0.0.15",
"grunt-changelog": "^0.2.2",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-copy": "^0.5.0",
@media (max-width:767px) {
#site-description {
display: none;
}
#secondary {
float: none !important;
}
#content {
@sinsunsan
sinsunsan / gist:3705693
Created September 12, 2012 10:03
Define an API to be used by hooks implementation
<?php
/**
* @file
* Documentation for Menu Attributes API.
*/
/**
* Alter the list of menu item attributes.
*