Skip to content

Instantly share code, notes, and snippets.

View benoror's full-sized avatar
🌀
In a quantum state between coding and procrastinating

Ben Orozco benoror

🌀
In a quantum state between coding and procrastinating
View GitHub Profile
@benoror
benoror / pgp.pub
Created February 8, 2016 19:34
PGP Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFMgUU0BEAC50m+8R2DVAG6hP9FurOBez+6ebhFWwzLqU5cTmS1jiNJvcQlf
keEhyYvqpncrcxAy+NCa/x1pLBWgOkJ0yEC85CNgLJOvmYj2zBE+y3ZWz9or72bB
KyrhnVkY7L3VE7fX0yhrKTsVrbRal/IRm8T8H2RXAxKnacybqEFksEBkS/lezu6S
EUVrLVJPPkjUWJypIi+4J9/iDtJ2nkblndlfQTxHgOR1xdpDpPIqRLBX0g+ppm2K
jH+LCovln9zKXUaxxLnFZs43XHbiRijsISxHjIVMkY/6c38khX4kFehSJ3LwmTo2
J5g/GvYhP+IaD5dvQGTuvVOP3El1M0nLGLxNo0tYqgwx7gsWdXLxdxWeJio1Z7Up
sjWxalaX8sEMYiK+JOlzSM5rDWfrvugviRYQyTFj8XrRyVj6EdqJ5v16ofQRw+0+
@pixelhandler
pixelhandler / transforms.js
Last active October 3, 2016 06:54
Raw object and array tranforms for Ember Data
/*
DS.attr('object')
*/
App.ObjectTransform = DS.Transform.extend({
deserialize: function(value) {
if (!$.isPlainObject(value)) {
return {};
} else {
return value;
}
@kentcdodds
kentcdodds / README.md
Last active July 29, 2017 15:37
upload-file

upload-file angular-formly type

This is my upload-file type for what I use at work. We use angular-upload for the upload service to do the actual file uploading. We also have several abstractions and use ES6 that may confuse you a little bit (sorry about that). Hopefully this gets you started though.

@NuckChorris
NuckChorris / array.js
Last active February 12, 2018 19:47 — forked from pixelhandler/transforms.js
In Ember-CLI, transforms are located in app/transforms/name.js
// app/transforms/array.js
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
deserialize: function(value) {
if (Ember.isArray(value)) {
return Ember.A(value);
} else {
return Ember.A();
@ggondim
ggondim / README.md
Created May 18, 2020 23:31
Airtable schema API request

Airtable Schema API

Replace the variables below in the script

  • YOURBASEID: your Airtable base ID starting with 'app...'
  • YOURCOOKIESFORAIRTABLEDOMAIN your browser cookie for airtable.com domain
@wassim
wassim / export_base_meta_from_airtable.js
Last active December 10, 2020 05:37
Export base meta data from Airtable
const fda = ( fields ) => {
let data = []
for(const f of fields ){
data.push(fd(f))
}
return data
}
const fd = ( field ) => {
let data = {
@benoror
benoror / user.rb
Created May 20, 2011 01:38
devise_invitable: Confirm after set password
class User < ActiveRecord::Base
devise :invitable, :database_authenticatable, :registerable, :recoverable,
:rememberable, :confirmable, :validatable, :encryptable
# ...
# devise confirm! method overriden
def confirm!
welcome_message
super
@coffeemug
coffeemug / gist:6168031
Last active February 3, 2022 23:16
The fun of implementing date support
After spending the better part of the month implementing date support
in RethinkDB, Mike Lucy sent the team the following e-mail. It would
have been funny, if it didn't cause thousands of programmers so much
pain. Read it, laugh, and weep!
-----
So, it turns out that we're only going to support dates between the
year 1400 and the year 10000 (inclusive), because that's what boost
supports.
@tannerlinsley
tannerlinsley / remove-linkin-connections.js
Created July 12, 2019 15:43
A script for removing LinkedIn connections automatically
function removeFirstConnection () {
$('[type=ellipsis-horizontal-icon]').first().click()
setTimeout(() => {
$('.js-mn-connection-card__dropdown-delete-btn > button').click()
setTimeout(() => {
$('[data-control-name="confirm_removed"]').click()
}, 250)
}, 250)
}
@davemo
davemo / api.proxy.server.js
Created November 6, 2012 21:56
A simple express.js server with a proxy that intercepts all requests with /api/ and proxies them to localhost:3000
var express = require('express'),
httpProxy = require('http-proxy'),
app = express();
var proxy = new httpProxy.RoutingProxy();
function apiProxy(host, port) {
return function(req, res, next) {
if(req.url.match(new RegExp('^\/api\/'))) {
proxy.proxyRequest(req, res, {host: host, port: port});