This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git forkSrcPrefix/src/server.h forkDstPrefix/src/server.h | |
| index cb555031edf80aa48e1a601368b5bc58c086ff46..813f98be5233043e1dd7ad5d847da118bf615f90 100644 | |
| --- forkSrcPrefix/src/server.h | |
| +++ forkDstPrefix/src/server.h | |
| @@ -3492,6 +3492,7 @@ void lrangeCommand(client *c); | |
| void ltrimCommand(client *c); | |
| void typeCommand(client *c); | |
| void lsetCommand(client *c); | |
| +void mergeSetsCommand(client *c); | |
| void saddCommand(client *c); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Controller } from "stimulus" | |
| import { DirectUpload } from "@rails/activestorage" | |
| import Dropzone from "dropzone" | |
| import { getMetaValue, findElement, removeElement, insertAfter } from "helpers" | |
| Dropzone.autoDiscover = false | |
| export default class extends Controller { | |
| static targets = [ "input" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from "react"; | |
| import { useMousePosition } from "~/hooks/useMousePosition"; | |
| /** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
| export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
| const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
| const [mouseX, mouseY] = useMousePosition(); | |
| const positions = { x, y, h, w, mouseX, mouseY }; | |
| return ( | |
| <div |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| seqs = ActiveRecord::Base.connection.execute("select sequence_name from information_schema.sequences;").map {|x| x['sequence_name']} | |
| seqs.each do |s| | |
| ActiveRecord::Base.connection.execute("SELECT SETVAL('public.#{s}', COALESCE(MAX(id), 1) ) FROM public.#{s.gsub("_id_seq", "")};") | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| require 'vips' | |
| module Superdocs | |
| module Opengraph | |
| class Image | |
| attr_reader :elements, :canvas, :borders, :canvas_color | |
| def initialize(width, height, color: '#ffffff') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install fonts-open-sans devscripts libfftw3-dev libmagickwand-dev libopenexr-dev liborc-0.4-0 gobject-introspection libgsf-1-dev libglib2.0-dev liborc-0.4-dev automake libtool swig gtk-doc-tools libpango1.0-dev -y | |
| git clone https://github.com/libvips/libvips.git | |
| cd libvips && ./autogen.sh && make && sudo make install | |
| ldconfig -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_og_image_preview(path, color: '#5168ec', message: ) | |
| unless File.exist?(path) | |
| rgb = color.match(/#(..)(..)(..)/)[1..3].map{|x| x.hex} | |
| im = Vips::Image.black(1200, 630).ifthenelse([0,0,0], rgb) | |
| text = Vips::Image.text message, width: im.width, dpi: 400, font: 'sans bold' | |
| text = text.gravity :centre, im.width, im.height | |
| overlay = (text.new_from_image [255, 255, 255]).copy interpretation: :srgb | |
| overlay = overlay.bandjoin text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'octokit' | |
| # !!! DO NOT EVER USE HARD-CODED VALUES IN A REAL APP !!! | |
| login = ENV['GH_LOGIN'] | |
| password = ENV['GH_LOGIN_PASSWORD'] | |
| repo = "gjtorikian/crud-test" | |
| master = client.ref(repo, "heads/master") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # gem https://github.com/AaronLasseigne/active_interaction | |
| module Excursion | |
| module Services | |
| class NewUser < ActiveInteraction::Base | |
| string :email | |
| def execute | |
| user = User.create(email: email) | |
| if user.persisted? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### DigitalOcean Ubuntu 18.04 x64 + Rails 5 + Nginx + Unicorn + PostgreSQL9.6 + Capistrano 3 | |
| SSH into Root | |
| $ ssh [email protected] | |
| Change Root Password | |
| $ passwd |
NewerOlder