Skip to content

Instantly share code, notes, and snippets.

View ricardovf's full-sized avatar

Ricardo Fritsche ricardovf

View GitHub Profile
@ricardovf
ricardovf / populate-zendesk-fields.js
Created July 12, 2019 14:16 — forked from stresslimit/populate-zendesk-fields.js
Pre-populate Zendesk new ticket fields via query params
jQuery(function($) {
if ( !$('#new_request') ) return
var query = window.location.search.substring(1);
var vars = query.split("&");
var match, fieldID;
for (var i=0; i<vars.length; i++) {
var pair = vars[i].split("=");
match = pair[0].match(/^request_fields\[([a-z_\d]+)\]$/)
if (match) {
@ricardovf
ricardovf / wget
Created April 4, 2018 19:02 — forked from jasperf/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@ricardovf
ricardovf / backup-mongodb-to-s3.sh
Last active February 2, 2018 17:27 — forked from caraboides/backup-mongodb-to-s3.sh
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
#!/bin/sh
set -e
HOST=127.0.0.1
DB=lista_do_dia
AWS_ACCESS_KEY_ID=XXXX
AWS_SECRET_ACCESS_KEY=YYYY
S3PATH="s3://meritt-backups/mongodb/$DB/"
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY /usr/bin/aws s3 mb $S3PATH
@ricardovf
ricardovf / watch.js
Created January 14, 2018 18:19 — forked from arleighdickerson/watch.js
hot reloading of server-side feathersjs application (put this in src/)
const logger = require('winston');
const invalidate = require('invalidate-module');
const { resolve } = require('path');
const chokidar = require('chokidar');
process.on('unhandledRejection', (reason, p) => {
logger.error('Unhandled Rejection at: Promise ', p, reason);
});
const src = (...args) => resolve(__dirname, ...args);
@ricardovf
ricardovf / saida t2
Last active September 27, 2017 01:09
------------------------------------------------
Método de Newton tracional com multiplicidade 1
------------------------------------------------
Polinômio original:
P(x) = + 1x^11 - 3.4x^10 + 2.35x^9 + 4.32x^8 - 7.1685x^7 + 1.56006x^6 + 3.287061x^5 - 2.480058x^4 + 0.531441x^3 + 0x^2 + 0x^1 + 0
Reduzindo grau do polinômio 3 vezes com a raíz de valor 0:
P(x) = + 1x^10 - 3.4x^9 + 2.35x^8 + 4.32x^7 - 7.1685x^6 + 1.56006x^5 + 3.287061x^4 - 2.480058x^3 + 0.531441x^2 + 0x^1 + 0
P(x) = + 1x^9 - 3.4x^8 + 2.35x^7 + 4.32x^6 - 7.1685x^5 + 1.56006x^4 + 3.287061x^3 - 2.480058x^2 + 0.531441x^1 + 0
P(x) = + 1x^8 - 3.4x^7 + 2.35x^6 + 4.32x^5 - 7.1685x^4 + 1.56006x^3 + 3.287061x^2 - 2.480058x^1 + 0.531441
@ricardovf
ricardovf / index.html
Created October 23, 2012 13:25
A CodePen by Hakim El Hattab. Avgrund - A modal concept with a visible level of depth between the page and modal layers.
<article class="avgrund-contents">
<h1>Avgrund</h1>
<p>
A modal concept with a visible level of depth between the page and modal layers. Click a button below to give it a try.
</p>
<button onclick="avgrund.activate( 'stack' );">Stack it</button>
<button onclick="avgrund.activate();">Grow it</button>
<p>
Uses CSS transforms to scale components and CSS filters to blur the page.
</p>
@ricardovf
ricardovf / index.html
Created October 23, 2012 13:22
A CodePen by Jeff Powers. Pure CSS Ribbon - A Clean, Simple, CSS Ribbon.
<div id="ribbon">
<span id="content">Hello There</span>
</div>
@ricardovf
ricardovf / index.html
Created October 23, 2012 13:22
A CodePen by vcurd. Depth of field effect with SVG filters - Depth of field effect on hover. Based on PNGs with alpha transparency and SVG filters in CSS3. Currently only works in Chrome.
<!-- This depth of field effect uses SVG filters in CSS3 it currently only works in Chrome -->
<div id="photoframe">
<img id="full" src="https://dl.dropbox.com/u/32918455/camera%20pics/full.png" />
<img class="blurable" data-blurindex="10" id="fullblur" src="https://dl.dropbox.com/u/32918455/camera%20pics/full.png" />
<img class="blurable" data-blurindex="8" id="lenses" src="https://dl.dropbox.com/u/32918455/camera%20pics/lens.png" />
<img class="blurable" data-blurindex="6" id="cameras" src="https://dl.dropbox.com/u/32918455/camera%20pics/camera.png" />
<img class="blurable" data-blurindex="4" id="film" src="https://dl.dropbox.com/u/32918455/camera%20pics/film.png" />
<img class="blurable" data-blurindex="2" id="filters" src="https://dl.dropbox.com/u/32918455/camera%20pics/filters.png" />
<img class="blurable" data-blurindex="0" id="loupes" src="https://dl.dropbox.com/u/32918455/camera%20pics/loupe.png" usemap="loupemap" />
<map id="loupemap" name="loupemap">
@ricardovf
ricardovf / index.html
Created October 23, 2012 13:19
A CodePen by Michael Martin-Smucker. CSS Stacked Paper Effect - Creating a messy stack of papers using the magic of CSS transforms and generated content.
<div class="letter">
<p>Dear Friends,</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent euismod porta tempor. Donec pulvinar turpis nec velit pellentesque quis rhoncus sapien facilisis. Mauris quis massa dui, rhoncus viverra quam. Nulla tempus, augue ut consectetur facilisis, arcu elit pellentesque arcu, sed rutrum orci turpis pulvinar augue. Donec eget arcu mauris. Vestibulum tristique consequat lacus eget laoreet. Integer sed nisl sed nibh pulvinar ornare quis nec quam. Aenean rhoncus ligula ut lectus placerat a commodo quam vulputate. In eu metus turpis.</p>
<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus facilisis erat in nibh auctor at aliquet velit vestibulum. Curabitur turpis diam, malesuada eu consequat eget, ultricies sed nunc. Aenean sed odio massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ornare vulputate congue. Quisque leo metus, condimentum nec molestie et, egestas luctus libero.</p>
<p>M
jQuery.fn.supersleight = function(settings) {
settings = jQuery.extend({
imgs: true,
backgrounds: true,
input_src: true,
shim: ‘data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAA AACXZwQWcAAAABAAAAAQDH lV/tAAAAAnRSTlMA/1uRIrUAAA AKSURBVAjXY/gPAAEBAQAbtu 5WAAAAAElFTkSuQmCC’,
apply_positioning: true
}, settings);
return this.each(function(){