Skip to content

Instantly share code, notes, and snippets.

View solon's full-sized avatar
🐝

Brian Solon solon

🐝
View GitHub Profile
@francolaiuppa
francolaiuppa / sequelize-schema-file-generator.js
Last active August 5, 2020 14:25 — forked from manuelbieh/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
'use strict';
//////////////////////////////////
// How to use?
// 1. Create `sequelize-schema-file-generator.js` in your app root
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders).
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports)
// 4. Run it with `node sequelize-schema-file-generator.js`
// 5. Review the generated migrations inside of the `migrations` folder.
//////////////////////////////////
@quinkennedy
quinkennedy / openframe_install.sh
Last active September 26, 2019 17:50
wget/curl-able installation script for Openframe
#!/usr/bin/env bash
{ # this ensures the entire script is downloaded #
openframe_has() {
type "$1" > /dev/null 2>&1
}
if [ -z "$OPENFRAME_DIR" ]; then
OPENFRAME_DIR="$HOME/.openframe"
@tgoldenberg
tgoldenberg / segment-analytics.m
Last active May 9, 2018 23:35
Segment Analytics for React Native
# AppDelegate.m
#import <Analytics/SEGAnalytics.h>
[SEGAnalytics setupWithConfiguration:[SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_ANALYTICS_KEY_HERE"]];
# AnalyticsHelper.h
#import "RCTViewManager.h"
#import "RCTBridgeModule.h"
@rrag
rrag / README.md
Last active March 19, 2024 16:11
Yet another tutorial and Cheat sheet to Functional programming

There are many tutorials and articles available online which explain functional programming. Examples show small functions, which are composed into others which again get composed. It is hard to imagine how it would all work, then come the analogies and then the math. While the math is necessary to understand it can be difficult to grasp initially. The analogies on the other hand, (at least for me) are not relatable. Some articles assume the reader knows the different terminologies of FP. Over all I felt it is not inviting to learn.

This introduction is for those who have had a tough time understanding those analogies, taken the plunge to functional programming but still have not been able to swim. This is yet another tutorial on functional programming

Terminology

Functions as first class citizens

Functions are first class means they are just like anyone else, or rather they are not special, they behave the same as say primitives or strings or objects.

@mnylen
mnylen / _.md
Last active April 23, 2021 21:17
Debounced fetching to reduce number of requests when doing API proxying through GraphQL

Simple implementation of debounced fetching in GraphQL to allow merging of multiple rest / database requests into one. Although this example uses GraphQL, the debouncedFetch / fetchProgramPlaycount implementations could probably be used in any context to achieve the same result.

This approach was first described by @leebyron at graphql/graphql-js#19 (comment)

For example this allows turning ten requests for playcounts from this GraphQL query into just one:

{
  latestPrograms(first: 10) {
    name,

playcount

@BorisKourt
BorisKourt / README.md
Last active August 29, 2015 14:23
Introduction to Clojure for Artists
# For SCSS-Lint v0.31.0
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
BorderZero:
@gnippy
gnippy / gist:7568243
Created November 20, 2013 18:18
Tweet (Original format)
{
"created_at": "Wed Nov 20 18:13:12 +0000 2013",
"id": 4.0322452267901e+17,
"id_str": "403224522679009280",
"text": "Enjoyed our half price chicken and wawfuls today! @tamusportclubs @SullysGrill @TAMUWaterski #SCPartnerday http:\/\/t.co\/XRsVqYy9Zo",
"source": "<a href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\">Twitter for Android<\/a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
@jonah-williams
jonah-williams / circle.yml
Last active May 29, 2019 14:53
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@wrburgess
wrburgess / gist:5528649
Last active September 13, 2024 19:00
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production