Skip to content

Instantly share code, notes, and snippets.

Danny Garcia dannygarcia

Block or report user

Report or block dannygarcia

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sketch-rename-layers.js
var sketch = require('sketch')
var document = sketch.getSelectedDocument()
var page = document.selectedPage;
var vFrom = 'v11';
var vTo = 'v12';
var symbols = page.layers.filter(l => l.name.indexOf(vFrom) > -1));
@dannygarcia
dannygarcia / convert.sh
Last active May 7, 2019
Convert Image Sequence to Animations
View convert.sh
# This is not intended to be run as an executable shell script file.
# These are just the commands I use directly in the terminal after `cd`-ing to the image sequence directory.
# Images are named in this format: ####.png
# Convert sequence to animated GIF (imagemagick)
convert -delay 2.5 -loop 0 *.png anim.gif
# Convert sequence to video @ 24fps (ffmpeg)
# https://avpres.net/FFmpeg/sq_H264.html
ffmpeg -r 24 -f image2 -i %04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p anim.mp4
@dannygarcia
dannygarcia / square.frag
Created Jun 28, 2017
Draws a square in a fragment shader (unoptimized implementation).
View square.frag
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
void main(){
vec2 st = gl_FragCoord.xy/u_resolution.xy;
@dannygarcia
dannygarcia / imagemap.html
Created Sep 16, 2016
Classic Site Image Map Preview
View imagemap.html
<style>
.box {
display: inline-block;
border: 2px solid #f2f2f2;
margin: 10px;
padding: 10px;
vertical-align: middle;
border-radius: 10px;
font-family: monospace;
color: #333;
View popup-video.js
javascript:(function()%7Bvar%20r%20%3D%20%2F%5E.*(%3F%3Avimeo%5C.com%5C%2F(%5Cw%7B8%7D)%7C(%3F%3Ayoutu.be%5C%2F%7Cv%5C%2F%7Cu%5C%2F%5Cw%5C%2F%7Cembed%5C%2F%7Cv%3D)(%5B%5E%23%5C%26%5C%3F%20%5D*)).*%2Fgi%2C%20m%20%3D%20r.exec(window.location.href)%3B%20if%20(m%5B1%5D)%20%7B%20window.open(%22http%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F%22%2Bm%5B1%5D)%3B%20%7D%20else%20if%20(m%5B2%5D)%20%7B%20window.open(%22http%3A%2F%2Fwww.youtube.com%2Fwatch_popup%2F%3Fv%3D%22%2Bm%5B2%5D%2C%20%22_blank%22%2C%20%22height%3D345%2Cwidth%3D560%22)%3B%20%7D%7D)()
View ac_retina.js
AC.Retina = AC.Class();
AC.Retina.prototype = {__defaultOptions: {attribute: "data-hires",recursive: true,queueSize: 8,publishNotifications: true},initialize: function ac_initialize(b) {
this._benchmarkTimer = new Date();
this._options = {};
this._globalBlacklist = null;
this._tagNameBlacklist = null;
this._images = [];
this._paused = false;
this._deferredQueue = null;
this.__queues = [];
View Default (OSX).sublime-keymap
[
{ "keys": ["ctrl+s"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+shift+j"], "command": "js_run" }
]
View _absolute.scss
@mixin absolute($top: false, $right: false, $bottom: false, $left: false) {
position: absolute;
@if $top != false {
top: $top;
}
@if $right != false {
right: $right;
}
@if $bottom != false {
bottom: $bottom;
@dannygarcia
dannygarcia / font.css
Created Apr 4, 2013
CSS to override default font styling in the LightGrid tumblr theme.
View font.css
#content, #content p, #content ul {
font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
}
View console.log.sublime-snippet
<snippet>
<content><![CDATA[
console.log(${0:msg});
]]></content>
<tabTrigger>cl</tabTrigger>
<scope>source.js</scope>
<description>console.log</description>
</snippet>
You can’t perform that action at this time.