Skip to content

Instantly share code, notes, and snippets.

View miguelramos's full-sized avatar
🔥
Making picasso moves 🏄‍♂️

Miguel Ramos miguelramos

🔥
Making picasso moves 🏄‍♂️
View GitHub Profile
@miguelramos
miguelramos / widget-chart.json
Created April 2, 2019 09:36
Kendo Chart Response
{[
{
type: 'line',
legend: false,
fullWidth: false,
expandable: true,
options: {
gap: 2,
spacing: '0.25'
},
@miguelramos
miguelramos / component.ts
Created January 21, 2017 00:19
Ui decorator example
/* THE COMPONENT EXAMPLE */
@Component({
moduleId: __filename,
selector: 'fs-home-page',
templateUrl: './home.template.html',
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [Animator.bounceIn(1000)],
styles: [`
:host {
@miguelramos
miguelramos / ui-element.ts
Last active January 21, 2017 00:19
Angular 2 decorator
export interface UIDecorator {
footer?: boolean;
navigator?: UINavbarState;
}
export class UIElement {}
export function UI(meta?: UIDecorator): any {
let decorator = <(meta?: UIDecorator) => any>makeDecorator(
'UI',
@miguelramos
miguelramos / analytics.js
Created September 22, 2015 13:57
Analytics.js Google Source
(function() {
/**
* @param {number} opt_attributes
* @return {undefined}
*/
function replace(opt_attributes) {
map.set(opt_attributes);
}
/**
* @param {Object} context
/**
* @jsx React.DOM
*/
var React = require('react'),
MyReactComponent = React.createClass({
// The object returned by this method sets the initial value of this.state
getInitialState: function(){
return {};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@miguelramos
miguelramos / changelog.sh
Created November 18, 2014 23:35
Bash Script for Group git log and writes to CHANGELOG.MD
#!/bin/bash
AUTHOR=$(git config user.name)
DATE=$(date +%F)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
FILE="$DIR/CHANGELOG.MD"
echo "#CHANGELOG ON" $DATE > $FILE
git log --no-merges --format="%cd" --date=short --no-merges --author="$AUTHOR" --all | sort -u -r | while read DATE ; do
if [[ $NEXT != "" ]]
then
@miguelramos
miguelramos / jquery.plugin.skeleton.js
Created October 2, 2014 13:53
jQuery module pattern skeleton
;(function($, undefined) {
// Save plugin name internally.
var pluginName = 'collapsible';
var Collapsible = function($el, options) {
var self = this;
/**
* Default options
@miguelramos
miguelramos / nginx.conf
Last active January 21, 2017 04:40
Nginx Grav
server {
listen 80;
server_name *.grav.dev;
root /home/www/grav.dev;
index index.html index.htm index.php;
charset utf-8;
location /user {
rewrite ^/user/accounts/(.*)$ /error redirect;
@miguelramos
miguelramos / PriorityCalculator.php
Last active August 29, 2015 14:03 — forked from fcaravana/PriorityCalculator.php
Random probability by weight.
<?php
class PriorityCalculator
{
private $data = array();
private $universe = 0;
public function add( $data, $probability )
{
$this->data[ $x = count( $this->data ) ] = new stdClass;