Skip to content

Instantly share code, notes, and snippets.

⛱️
Le vent se lève, il faut tenter de vivre.

Daniel Gutiérrez degt

⛱️
Le vent se lève, il faut tenter de vivre.
View GitHub Profile
@apaatsio
apaatsio / dynamodb-rest-api-lambda.js
Last active Sep 13, 2019
Single Lambda function for all CRUD operations with DynamoDB in REST API
View dynamodb-rest-api-lambda.js
console.log('Loading function');
var doc = require('dynamodb-doc');
var dynamo = new doc.DynamoDB();
/**
* Provide an event that contains the following keys:
*
* - operation: one of the operations in the switch statement below
* - tableName: required for operations that interact with DynamoDB
@harrisonde
harrisonde / gist:90431ed357cc93e12b51
Last active Jul 5, 2020
Deploy Laravel 5 applications on AWS Elastic Beanstalk
View gist:90431ed357cc93e12b51
# The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk.
# Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config)
# -------------------------------- Commands ------------------------------------
# Use "commands" key to execute commands on the EC2 instance. The commands are
# processed in alphabetical order by name, and they run before the application
# and web server are set up and the application version file is extracted.
# ------------------------------------------------------------------------------
commands:
01updateComposer:
@franquis
franquis / PostController.php
Last active Jun 5, 2020
Summernote image upload with PHP (Laravel + Intervention\lmage)
View PostController.php
<?php
/**
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally
* and replace the 'src' attribute in the submited HTML content
*
**/
use Intervention\Image\ImageManagerStatic as Image;
class PostController {
public function edit(){
@allaniftrue
allaniftrue / filters.php
Last active Mar 16, 2019
Laravel Minify HTML response
View filters.php
<?php
/*
* An improvised Gist from
* https://gist.github.com/zmsaunders/5619519
* https://gist.github.com/garagesocial/6059962
*/
App::after(function($request, $response)
{
if(App::Environment() != 'local')
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Jul 9, 2020
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@abarza
abarza / Default New Doc Sizes.doc
Last active Dec 10, 2015
Document presets for Photoshop, replacing the default values given by the software with the Android and iOS screen sizes.
View Default New Doc Sizes.doc
;------------------------------------------------------------------------------
; Generic mobile device sizes
;------------------------------------------------------------------------------
"mobile"
"Android LDPI Small QVGA" 240 320 pixels 120 dpi RGB 8 1.0 white "none"
"Android LDPI Normal WQVGA400" 240 400 pixels 120 dpi RGB 8 1.0 white "none"
"Android LDPI Normal WQVGA432" 240 432 pixels 120 dpi RGB 8 1.0 white "none"
"Android LDPI Extra Large" 1024 600 pixels 120 dpi RGB 8 1.0 white "none"
@nolim1t
nolim1t / home.jade
Created May 11, 2012
Sample Templating with express and jade
View home.jade
h2 Hello World
h3 Hello World
:markdown
This is some **test** markdown text
we can even link to [stuff](http://google.com)
ul.list
- each i in data
li=i.name
@travishaynes
travishaynes / google_fonts_helper.rb
Created Jan 10, 2012
Google Fonts Rails helper
View google_fonts_helper.rb
module GoogleFontsHelper
# generates a link tag for Google fonts
# @param [Hash] fonts contains the font families and weights
# @return [String] The generated link tag
# @example Droid+Sans in weights 400 and 700, and Yanone+Kaffeesatz in 300 and 400
# = google_fonts_link_tag :droid_sans => [400, 700], :yanone_kaffeesatz => [300, 400]
def google_fonts_link_tag(fonts = {})
family = fonts.inject([]) do |result, (font, sizes)|
# convert font into a String
font = font.to_s
@mudge
mudge / gist:221616
Created Oct 29, 2009
A simple rich text editor with jQuery and iframe designMode.
View gist:221616
/*
* A very basic rich text editor using jQuery and iframe designMode.
*
* In your HTML...
* <input type="hidden" id="article_body" name="article[body]">
* <iframe id="paste"></iframe>
*/
/*
* NOTE: The order of writing and setting designMode is very important.
You can’t perform that action at this time.