Skip to content

Instantly share code, notes, and snippets.

Avatar

Felipe Delgado felideon

View GitHub Profile
View svelte-inside.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@felideon
felideon / make_arrow.js
Last active Jul 17, 2018
Sketch — Add arrowhead to selected layers
View make_arrow.js
var sketch = require('sketch/dom');
var document = sketch.getSelectedDocument();
var selection = document.selectedLayers;
selection.forEach(layer => {
layer.style.borderOptions.endArrowhead = 'OpenArrow'
});
@felideon
felideon / count_symbols.js
Last active Jul 17, 2018
Sketch — Count number of symbol instances in the selected page
View count_symbols.js
var sketch = require('sketch/dom');
var UI = require('sketch/ui');
var document = sketch.getSelectedDocument();
var page = document.selectedPage;
var message;
var symbol_count = 0;
function countSymbols(layer) {
@felideon
felideon / main.dart
Created May 22, 2018
Friendlychat App
View main.dart
import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:firebase_database/ui/firebase_animated_list.dart';
import 'package:firebase_storage/firebase_storage.dart';
@felideon
felideon / makeArrow.js
Last active Jun 13, 2017
Add arrow head to end of line or vector.
View makeArrow.js
/* Thanks to sample code here:
https://github.com/wodory/flowmate
https://github.com/turbobabr/Sketch-Plugins-Cookbook
*/
var selection = context.selection;
var layer = selection.firstObject();
if(layer && layer.isKindOfClass(MSShapeGroup)) {
View advent-2016-day2.lisp
(in-package #:cl-advent-2016)
(defparameter *keypad* nil)
(defparameter *key* 5)
(defun key-position ()
(mapcar (lambda (row) (position *key* row)) *keypad*))
(defun row-index ()
@felideon
felideon / org-mobile-push-on-save.el
Created Jul 22, 2016
Automatically syncing MobileOrg after suffer org-mode buffers
View org-mobile-push-on-save.el
(defun org-mobile-push-on-save ()
"Used in `after-save-hook'."
(when (memq this-command '(save-buffer save-some-buffers))
(org-mobile-push)))
(add-hook 'org-mode-hook
(lambda ()
(add-hook 'after-save-hook 'org-mobile-push-on-save nil 'make-local)))
View application.html.erb
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "https://js.stripe.com/v1/", "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%= tag :meta, :name => "stripe-key", :content => STRIPE_PUBLIC_KEY %>
View form-render-methods.lisp
(defmethod render :around ((form form-component))
(<:form :method "post"
:action "mailto:felideon+blog@gmail.com"
(call-next-method)))
(defmethod render :before ((form form-component))
(<:h1 (<:as-html "Book Order Form")))
(defmethod render ((form form-component))
(<:as-html "Name: ") (<:text :name "Name") (<:br)
View method-combination-semantics
"Same semantics as standard method combination but allows
\"wrapping\" methods. Ordering of methods:
(wrap-around
(around
(before)
(wrapping
(primary))
(after)))
You can’t perform that action at this time.