Skip to content

Instantly share code, notes, and snippets.

View dennmart's full-sized avatar

Dennis Martinez dennmart

View GitHub Profile
@rdh27785
rdh27785 / openssl.cnf.diff
Created May 4, 2022 02:42
diff -uN /etc/ssl/openssl.cnf\~original /etc/ssl/openssl.cnf for Nextcloud with OpenSSL 3
--- /etc/ssl/openssl.cnf~original 2022-03-16 08:35:51.000000000 +0000
+++ /etc/ssl/openssl.cnf 2022-05-04 02:37:30.336530711 +0000
@@ -56,6 +56,7 @@
# List of providers to load
[provider_sect]
default = default_sect
+legacy = legacy_sect
# The fips section name should match the section name inside the
# included fipsmodule.cnf.
# fips = fips_sect
@jesster2k10
jesster2k10 / README.md
Last active April 25, 2024 00:54
JWT Auth + Refresh Tokens in Rails

JWT Auth + Refresh Tokens in Rails

This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.

I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)

Before trying it out DIY, I considered using:

@marcospedreiro
marcospedreiro / font_letter_check.txt
Created May 16, 2018 04:39
/u/martinus test pattern to check how distingushable characters are for a font
From: https://www.reddit.com/r/programming/comments/8jjq33/11_best_programming_fonts/dz0xxs5/
------
o0O s5S z2Z !|l1Iij {([|})] .,;: ``''""
a@#* vVuUwW <>;^°=-~ öÖüÜäÄßµ \/\/
the quick brown fox jumps over the lazy dog
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
0123456789 &-+@ for (int i=0; i<j; ++i) { }
@ondrejbartas
ondrejbartas / how_to_setup_cypress_with_rails_app.md
Last active April 2, 2021 01:15
How to setup Cypress on Rails apps

How to setup Cypress on Rails apps

You need to update circle.yml:

machine:
  node: # add node dependency
    version:
      7.4

environment:
@pshoukry
pshoukry / api.js
Created March 6, 2017 14:18
React / Redux fetch from rails server with CSRF token
import _ from 'underscore';
import fetch from 'isomorphic-fetch'
class API {
getCSRFToken() {
return _.find(document.getElementsByTagName('meta'), (meta) => {
return meta.name === 'csrf-token'
}).content
}
@joerodrig
joerodrig / ReactRailsWebpackRefetch.md
Last active March 16, 2016 03:33
React + Rails + Webpack and React-Refetch

Overview and Goals

React_On_Rails is an awesome library that integrates React + Rails + Webpack, with boilerplate to quickly get you up and running on a new project. React-Refetch is also another great library that makes reading and writing data to the server in React seamless. My goal here is to develop an architecture leveraging these two libraries that accomplishes three goals:

  1. Simple
  2. Easy to maintain
  3. Scalable

To accomplish this, our architecture will leverage React-Refetch and Rails routing to expose each component to the data needed on each given page, using our server data as the single source of truth, therefore minimizing or, idealy, completely removing our use of state to modify data on many pages. This reduces the fragile nature of offloading a batch of data to one large root component and dispersing it among nested sub-components. This also allows us to always have a 1-to-1 relationship betwee

@caseywatts
caseywatts / MediawikionHeroku.md
Last active August 16, 2022 06:28
Mediawiki on Heroku
@drkarl
drkarl / gist:739a864b3275e901d317
Last active October 17, 2023 10:43
Ask HN: Best Linux server backup system?

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.
@rauchg
rauchg / effective-es6.md
Last active July 11, 2023 09:38
Writing ES6 today, effectively.

Effective transpiling of ES6

After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.

I refrained from including these details on the original post because they're subject to immiment obsoletion. These tools are changing and evolving quickly, and some of these instructions are likely to become outdated in the coming months or even weeks.

The main tool

When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. I chose it based on:

@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));