Skip to content

Instantly share code, notes, and snippets.

@JuanVqz
JuanVqz / simple_form_bulma.rb
Last active December 24, 2023 17:52
Support for simple form with bulma css, copy and paste on config/initializers/simple_form_bulma.rb
# frozen_string_literal: true
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Default class for buttons
config.button_class = "button"
# Define the default class of the input wrapper of the boolean input.
config.boolean_label_class = "checkbox"
@chrpinedo
chrpinedo / insert-signature-in-pdf.md
Created April 4, 2016 10:27
How to insert your signature in a PDF file by using PDFtk

How to insert your signature in a PDF file by using PDFtk

Your signature in all the sheets

  1. convert the signature image to PDF file
convert firma.png firma.pdf
@rtt
rtt / tinder-api-documentation.md
Last active February 27, 2024 13:21
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@surjikal
surjikal / prediction-io-ubuntu-precise.md
Last active March 24, 2017 11:33
Prediction IO Install Notes on Ubuntu Precise (12.04)
require 'stringio'
class RedisSubscribe < EM::Connection
def self.connect(host, port, pass = '')
Rails.logger.debug host
Rails.logger.debug port
client = EM.connect host, port, self
client.auth pass if pass.present?
@Munter
Munter / example.server.config
Created May 16, 2013 08:42
Nginx example setup for a single page web application with far future expires static content in /static/ and proxying to several backends on any other request that /static or /.
upstream backends {
ip_hash;
server 0.0.0.0:80;
server 0.0.0.0:80;
}
server {
server_name app.falconsocial.com;
$(document).on "page:change", ->
window.prevPageYOffset = window.pageYOffset
window.prevPageXOffset = window.pageXOffset
$(document).on "page:load", ->
if $(".fix-scroll").length > 0
$('.fix-scroll').hide().show() # force re-render -- having an issue with that on Chrome/OSX
window.scrollTo window.prevPageXOffset, window.prevPageYOffset
@bshamric
bshamric / cache.js
Last active January 24, 2021 12:08
I like phantomjs, but it doesn't directly support getting images from webpages without requesting them separately like in casperjs. I went through QTNetworking code in the phantomjs repo until I figured out where the cache was. To use this, have all three files in the same directory. Then modify test.js for whatever you need. Call phantom js wit…
var fs = require('fs');
//this is the path that QTNetwork classes uses for caching files for it's http client
//the path should be the one that has 16 folders labeled 0,1,2,3,...,F
exports.cachePath = '/path/to/phantomjs/cache/data/folder';
//this is the extension used for files in the cache path
exports.cacheExtension = "d";
//the resources that are to be saved
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active March 28, 2024 11:13
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname