Skip to content

Instantly share code, notes, and snippets.

View nedSaf's full-sized avatar
👨‍💻
I may be slow to respond.

Nader Safadi nedSaf

👨‍💻
I may be slow to respond.
View GitHub Profile
@nedSaf
nedSaf / cus-col-bootstrap
Last active August 29, 2015 14:05
Custom bootstrap column
// Creating a custom column set for the stats row in footer.
.col-md-15 {
position: relative;
min-height: 1px;
padding-right: $grid-gutter-width;
padding-left: $grid-gutter-width;
@media (min-width: $screen-md-min) {
width: 20%;
float: left;
@nedSaf
nedSaf / gruntfile.js
Created August 11, 2014 07:32
Bootstrap Glyphicons copy task for grunt build.
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
src: [
// Jekyll processes and moves HTML and text files.
// Usemin moves CSS and javascript inside of Usemin blocks.
// Copy moves asset files and directories.
@nedSaf
nedSaf / gist:7679fdb3fad7f9f4339d
Created August 12, 2014 08:49
Gruntfile.js - bootstrap JS
module.exports = function(grunt) {
grunt.initConfig({
less: {
production: {
options: {
paths: ["bower_components/bootstrap/less"],
yuicompress: true
},
files: {
@nedSaf
nedSaf / gist:ae23dc9a6ca0d37bc78f
Created August 13, 2014 09:42
Create a function in mixins.
// Mixins
@mixin gradient($color) {
background: -webkit-linear-gradient(top, $color 0%,$color 100%);
background: -o-linear-gradient(top, $color 0%,$color 100%);
background: -ms-linear-gradient(top, $color 0%,$color 100%);
background: linear-gradient(top, $color 0%,$color 100%);
background: -moz-linear-gradient(top, $color 0%,$color 100%);
}
@nedSaf
nedSaf / gist:d5bab0d8011a8a0249bf
Last active August 29, 2015 14:05
Popover requires tooltip.js
If you are getting this error:
Uncaught Error: Popover requires tooltip.js
Just change the order of the JS files in your "bootstrap_subtheme.info" file.
"tooltip.js" should be above "popover.js"
scripts[] = '../../../libraries/bootstrap_sass/vendor/assets/javascripts/bootstrap/tooltip.js'
scripts[] = '../../../libraries/bootstrap_sass/vendor/assets/javascripts/bootstrap/popover.js'
@nedSaf
nedSaf / gist:41fb11d4413b2a307266
Last active April 4, 2021 03:29
Adding Leaflet-image to Leaflet-angular-directive
L_PREFER_CANVAS = true;
leafletData.getMap().then(function(map) {
leafletImage(map, function(err, canvas) {
var img = document.createElement('img');
var dimensions = map.getSize();
img.width = dimensions.x;
img.height = dimensions.y;
img.src = canvas.toDataURL();
@nedSaf
nedSaf / gist:40a9552a7b5c6f5ed927
Created September 9, 2014 12:22
Changes to leaflet-image Javascript file if you have awesome-marker
// Comment this function call.
// Skipping drawing the markers because we don't need them (CORS error).
//map.eachLayer(drawMarkerLayer);
@nedSaf
nedSaf / map.js
Last active March 19, 2022 21:18
Get center of a layer (GeoJson) in leaflet map.
// Assuming you are inside an event (Mouseover, Click).
// Layer comes from the event.
// Get the bounds of the layer to display the popup on the north-east bounds.
var bounds = layer.getBounds();
var latLng = bounds.getCenter();
@nedSaf
nedSaf / Behat phantomJs install
Last active August 29, 2015 14:09
Run behat tests with phantomJs
1. Install phantomJs on local machine.
sudo apt-get update
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev libxft-dev
sudo apt-get install phantomjs
2. Activate phantomJs from the terminal in a new tab (This should be kept running with the behat testing).
phantomjs --webdriver=8643
@nedSaf
nedSaf / behat login
Last active August 29, 2015 14:09
Behat login
<?php
/**
* Initializes context.
*
* Every scenario gets its own context object.
*
* @param array $parameters.
* Context parameters (set them up through behat.yml or behat.local.yml).
*/