Skip to content

Instantly share code, notes, and snippets.

View boniattirodrigo's full-sized avatar

Rodrigo Boniatti boniattirodrigo

View GitHub Profile
@moiseshilario
moiseshilario / cookie.js
Created June 24, 2019 17:43
Handle Cookie JS
Ruby e Rails
Guias:
http://guides.rubyonrails.org/
Livros (Free mas vale pagar um café para o autor ;) ):
https://leanpub.com/conhecendo-ruby
Livros (Pagos):
https://leanpub.com/conhecendo-rails
@dvlden
dvlden / ffmpeg.md
Last active May 14, 2024 14:25
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@matheusazzi
matheusazzi / poker.ex
Last active July 20, 2017 17:12
poker.ex
defmodule Poker do
## Rank a poker hand
##
## Card is {:suit, value}, e.g. {:heart, 3}
## Hand is a list of 5 cards
##
## Poker.rank [{:heart, 10}, {:club, 11}, {:heart, 9}, {:diamond, 12}, {:heart, 13}]
## >> :straight
def rank(hand) do
# frozen_string_literal: true
class Things::Something
Result = Data.define(:thing, :errors) do
def initialize(thing: nil, errors: [])
super
end
def successful?
errors.empty?
@brianleroux
brianleroux / wtf-sns-apns.js
Created August 5, 2016 23:00
Send a silent push notification to APNS with AWS SNS.
sns.publish({
TargetArn: device.arn,
MessageStructure: 'json',
Message: JSON.stringify({
default: 'you will never see this muah!',
APNS_SANDBOX: JSON.stringify({
aps: {
'alert': '',
'content-available': 1
},
@BastinRobin
BastinRobin / README.md
Created March 11, 2016 17:01
Django URL regex

Common Regular Expressions for Django URLs

A list of comman regular expressions for use in django url's regex.

Example Django URLs patterns:

urlpatterns = patterns('',
@mdang
mdang / RAILS_CHEATSHEET.md
Last active May 13, 2024 14:04
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
# coding: utf-8
import os
import StringIO
from xhtml2pdf import pisa
from xhtml2pdf.pdf import pisaPDF
from django.template.loader import render_to_string
from django.conf import settings