Skip to content

Instantly share code, notes, and snippets.

View devakone's full-sized avatar
💭
coding...

Abou Koné devakone

💭
coding...
View GitHub Profile
@eberfreitas
eberfreitas / sluggable.php
Created March 19, 2010 19:46
My Sluggable Behaviour for CakePHP based on Mariano Iglesias' behaviour
<?php
App::import('Inflector');
class SluggableBehavior extends ModelBehavior {
private $_settings = array();
function setup(&$model, $settings = array()) {
$default = array(
@benjchristensen
benjchristensen / index.html
Created May 2, 2012 19:37
Line Graph with Dual-scaled Axes using SVG and d3.js
<html>
<head>
<title>Line Graph with Dual-scaled Axes using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke-width: 1;
fill: none;
}
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

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>
class="[a-zA-Z0-9:;\.\s\(\)\-\,]*"
@plentz
plentz / nginx.conf
Last active July 22, 2024 11:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@runeb
runeb / js-exif-rotate.html
Created May 23, 2014 10:49
Auto-rotate images locally in the browser by parsing exif data
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input id="file" type="file" accept="image/*" />
<br/>
<h2>As read:</h2>
<img id="placeholder1" width=300/><br/>
<h2>Rotated by exif data:</h2>
<img id="placeholder2" width=300/>
<script>
@yesvods
yesvods / gist:51af798dd1e7058625f4
Created August 15, 2015 11:13
Merge Arrays in one with ES6 Array spread
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]
@stephenharris
stephenharris / jenkins-ec2-continous-integration.md
Last active May 15, 2023 00:16
How to set up CI with Jenkins on AWS EC2 (and some notes)
@david-meza
david-meza / geocoderService.js
Last active July 19, 2017 17:22 — forked from benmj/geocoder-service.js
An AngularJS Service for intelligently geocoding addresses using Google's API. Queries Google's API synchronously to avoid `google.maps.GeocoderStatus.OVER_QUERY_LIMIT`
(function(angular) {
'use strict';
angular.module('geocoder', ['uiGmapgoogle-maps', 'ngStorage']).factory('geocoderService', ['$q', '$timeout', 'uiGmapGoogleMapApi', '$localStorage',
function ($q, $timeout, mapsApi, $localStorage) {
var locations = $localStorage.locations ? JSON.parse($localStorage.locations) : {};
console.log(locations);
@krschmidt
krschmidt / head.html
Last active July 12, 2024 10:40
Set Canonical URL via Javascript
<script type='text/javascript'>
var link = !!document.querySelector("link[rel='canonical']") ? document.querySelector("link[rel='canonical']") : document.createElement('link');
link.setAttribute('rel', 'canonical');
link.setAttribute('href', location.protocol + '//' + location.host + location.pathname);
document.head.appendChild(link);
</script>