Skip to content

Instantly share code, notes, and snippets.

@daver182
daver182 / machine.js
Created April 7, 2020 18:11
Generated by XState Viz: https://xstate.js.org/viz
const inicioStates = {
id: 'inicio',
type: 'parallel',
states: {
menuOpciones: {
initial: 'idle',
states: {
idle: {
on: {
CLICK_INICIO_MENUOPCIONES_IDLE: 'active'
@daver182
daver182 / machine.js
Last active March 31, 2020 13:45
Generated by XState Viz: https://xstate.js.org/viz
const buscarStates = {
id: 'file',
type: 'parallel',
states: {
upload: {
initial: 'idle',
states: {
idle: {
on: {
INIT_UPLOAD: 'pending'
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@daver182
daver182 / app.js
Last active August 29, 2015 13:59
Getting data from a ASP Webservice
//Then in the app.js file we set the interceptor
var app = angular.module('appName', ['xml'])
.config(function ($routeProvider, $httpProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/view1.html',
controller: 'Controller1',
})
.when('/view2', {
templateUrl: 'views/view2.html',
@daver182
daver182 / fullscreen_api
Created April 17, 2014 11:55
Fullscreen API
function launchFullScreen(element) {
if(element.requestFullscreen) {
element.requestFullscreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if(element.msRequestFullscreen) {
element.msRequestFullscreen();
}
@daver182
daver182 / filter.js
Last active August 29, 2015 13:59
Simple filter in Angularjs
//First we create the filter, is very simple. When you get the input it has all the items from the ngRepeat directive, then you
//iterate all over the array in compare the value with something, if it's right you push it into an output array.
'use strict';
angular.module('appName').filter('filterName', function (Util, Events) {
return function (input) {
if(input && input.length > 0){
var out = [];
for (var i = 0; i < input.length; i++) {
var value = input[i].counter;