Skip to content

Instantly share code, notes, and snippets.

View adrienpoly's full-sized avatar
💭
I may be slow to respond.

Adrien Poly adrienpoly

💭
I may be slow to respond.
View GitHub Profile
@hanxue
hanxue / Clone-Github-Wiki-Pages.sh
Created January 18, 2014 10:21
Cloning Github Wiki Pages
hanxue-mac:Github hanxue$ git clone https://github.com/AppScale/appscale.wiki.git
Cloning into 'appscale.wiki'...
remote: Counting objects: 1745, done.
remote: Compressing objects: 100% (1733/1733), done.
remote: Total 1745 (delta 1089), reused 10 (delta 4)
Receiving objects: 100% (1745/1745), 267.93 KiB | 35.00 KiB/s, done.
Resolving deltas: 100% (1089/1089), done.
Checking connectivity... done
hanxue-mac:Github hanxue$ ls appscale.wiki/
.git/
@fidothe
fidothe / pdfx.rb
Last active October 10, 2023 15:57
Worked example for creating a PDF/X-1a:2003 document with Prawn
require 'prawn'
require 'prawn/measurements'
# I have a small collection of links to the resources I used to figure all
# this out: http://pinboard.in/u:fidothe/t:pdfx
module PDFX
class PageBox
include Prawn::Measurements
attr_reader :bleed_mm
import sinonStubPromise from 'sinon-stub-promise';
import sinon from 'sinon'
sinonStubPromise(sinon)
let stubedFetch = sinon.stub(window, 'fetch') )
window.fetch.returns(Promise.resolve(mockApiResponse()));
function mockApiResponse(body = {}) {

Fixing Webpacker 3.3.0 + Rails 5.1.5

Heroku hosting trouble

Heroku may not detect a correct buildpack for your JS dependencies, then you have to set it manually:

heroku buildpacks:add heroku/nodejs -i 1
heroku buildpacks:add --index 2 https://github.com/heroku/heroku-buildpack-ruby
@mrmartineau
mrmartineau / stimulus.md
Last active August 26, 2024 05:54
Stimulus cheatsheet
@scottharvey
scottharvey / stimulus.md
Last active October 8, 2021 19:57 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@Intrepidd
Intrepidd / cop.rb
Last active December 14, 2018 16:37
class RuboCop::Cop::Security::LinkToBlank < RuboCop::Cop::Cop
MSG = 'Specify a `:rel` option containing noopener.'.freeze
def_node_matcher :link_to?, <<-PATTERN
(send nil? :link_to ...)
PATTERN
def_node_matcher :blank_target?, <<-PATTERN
(pair {(sym :target) (str "target")} (str "_blank"))
PATTERN
@lucaspiller
lucaspiller / .gitlab-ci.yml
Last active April 14, 2022 09:07
Rails 5.2 + Docker + Gitlab Continuous Deployment
image: ruby:2.6
services:
- postgres:11-alpine
variables:
POSTGRES_DB: myorg_test
CONTAINER_IMAGE: registry.gitlab.com/myorg/myapp
stages:
@ireneybean
ireneybean / app.rb
Created August 3, 2019 21:05
Stimulus.js without a build system, but with babel, Sinatra
#...
get '/' do
haml :index, layout: false
end
#...
@danielwestendorf
danielwestendorf / pre-commit
Last active May 6, 2021 15:38
Enforce codestyle automatically on git commit
#!/bin/sh
# Create this file here: ./.git/hooks/pre-commit
# chmod +x ./.git/hooks/pre-commit
.git/hooks/pre-commit-format-js
.git/hooks/pre-commit-format-ruby