Skip to content

Instantly share code, notes, and snippets.

View andresgutgon's full-sized avatar
:octocat:
Coding things...

Andrés andresgutgon

:octocat:
Coding things...
  • Barcelona
View GitHub Profile
@cayter
cayter / repository.ts
Last active May 17, 2024 04:28
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
# Rails production setup via SQLite3 made durable by https://litestream.io/
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine.
#
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails
#
# in production you might want to map /data to somewhere on the host,
# but you don't have to!
#
FROM ruby:3.0.2
# SWAP The fcsonline way
# First make yourself sudo like this
sudo su
# The copy these lines in the console
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
@edulan
edulan / index.js
Last active August 26, 2016 14:58
Logs event listeners for a DOM element and its ancestors (Chrome only)
function logListenersForElement(element, eventType) {
if (!element) return;
const eventListeners = getEventListeners(element);
if (Object.keys(eventListeners).indexOf(eventType) !== -1) {
console.log({
element,
listeners: eventListeners[eventType],
});
@FezVrasta
FezVrasta / Popper.jsx
Last active August 19, 2020 13:12 — forked from ebakan/Popper.js
React Component for Popper.js v1 that takes the reference as its first child and the popper as its second child (a la react-tether)
import React, { Component, PropTypes } from 'react';
import PopperJS from 'popper.js';
export default class Popper extends Component {
state = {}
update = () => {
if (this.popperInstance) {
this.popperInstance.scheduleUpdate();
}
IPFS Barcelona hack day
libP2P
github.com/IPFS/specs
github.com/IPFS/pm
Download and install ipfs
Ipfs init
@sergigracia
sergigracia / pr-description-generator.js
Last active August 29, 2015 14:14
PR description generator
/*
Add this as bookmark in your browser and tap on the bookmark when your are creating a new PR.
Example: http://cl.ly/image/0D1k0d1W1R0Y/Screen%20Shot%202015-01-26%20at%203.57.30%20PM.png
*/
javascript:(function() {
var e = document.getElementById('pull_request_body');
if (e) {e.value +='#### :tophat: What? Why?\n\n\n#### :dart: What should QA test?\n\n\n#### :pushpin: Related tasks?\n\n\n#### :clipboard: Developer checklist\n- [ ] Unit Tests (if necessary)\n- [ ] UI Snapshot Tests (if necessary)\n- [ ] Added accessibility tags to any interactive element\n- [ ] Added reporting for GA (events + screen views) / Errors / Exceptions\n- [ ] Documentation\n\n#### :ghost: GIF\n![]()';}
})();
var Dialog = React.createClass({
render: function() {
// 1) render nothing, this way the DOM diff will never try to do
// anything to it again, and we get a node to mess with
return React.DOM.div();
},
componentDidMount: function() {
// 2) do DOM lib stuff
this.node = this.getDOMNode();
@jaimeiniesta
jaimeiniesta / rails_jobs.txt
Last active November 15, 2018 09:15
Resources to find a job as a Rails developer
The following is a list of places where you can find job offers as a Rails developer:
https://twitter.com/currofile
https://twitter.com/domestikaempleo #spain only
http://www.workingwithrails.com/
https://weworkremotely.com/jobs/search?term=rails
https://jobs.github.com/
http://trabajosrails.com/ # spain only
http://www.indeed.com/q-Ruby-On-Rails-Developer-jobs.html
@ryanb
ryanb / index.js.erb
Created December 16, 2011 23:22
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>