Skip to content

Instantly share code, notes, and snippets.

@joshuabradley012
joshuabradley012 / Object collisions with canvas
Last active June 3, 2025 18:30
An example of 2D collisions using JavaScript Canvas
class State {
constructor(display, actors) {
this.display = display;
this.actors = actors;
}
update(time) {
/**
* provide an update ID to let actors update other actors only once
@vhermecz
vhermecz / custom_keys_git_ssh
Created June 8, 2020 11:20
Allow configuring multiple ssh deploy keys with git
#!/bin/bash
# Script to use custom ssh keys for various git repositories
# Run without arguments to get usage info.
#
# How it works:
# When used with SSH, git sends the path to the repository in the SSH command.
# @see: https://github.com/git/git/blob/e870325/connect.c#L1268
# We extract this info and search for a key with the name.
# Based on the source, this seems to be used format since v2.0 at least.
# @see: https://github.com/git/git/commit/a2036d7
@kardeiz
kardeiz / mlt.rs
Last active May 22, 2020 18:35
`MoreLikeThis` query for `tantivy`
use std::collections::{BinaryHeap, HashMap};
use tantivy::{
query::{BooleanQuery, BoostQuery, Occur, Query, TermQuery, Weight},
schema::{FieldType, IndexRecordOption, Schema, Term, Value},
tokenizer::{
BoxTokenStream, FacetTokenizer, PreTokenizedStream, StopWordFilter, TokenFilter, Tokenizer,
TokenizerManager,
},
Document, Searcher,

Uberspace

Uberspace is webhosting for nerds and everybody. Currently uberspace is aroudn 12 people who do what they do to make technology more approachable.

It is a great place to learn and test and also run small projects (or not so small ones) in production.

It is shared hosting - that makes some things a little bit difficult - but if you run into problems they are a great help.

Nuxt

@oncomouse
oncomouse / StyledTransition.js
Last active April 15, 2021 05:24
Using CSSTransitionGroup with Emotion.js
import React from 'react';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { CSSTransition } from 'react-transition-group';
const has = (key, obj) => Object.prototype.hasOwnProperty.call(obj, key);
const keyframes = [
'appear',
'enter',
function Mutilator(data, name, context) {
this.n = name || `mutilation-${+new Date()}`;
this.d = data;
this.c = context || window;
this.isArr = function(p) {
return this.d[p].constructor == Array;
};
this.dispatch = function(p, v, t) {
this.c.dispatchEvent(
new CustomEvent(this.n, {
@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@Luzifer
Luzifer / Dockerfile
Last active January 17, 2024 16:26
Ruby 1.8.7 Docker container based on Debian Jessie
FROM debian:jessie
ENV RUBY_VERSION 1.8.7-p374
ENV PATH /usr/local/rvm/gems/ruby-${RUBY_VERSION}/bin:/usr/local/rvm/gems/ruby-${RUBY_VERSION}@global/bin:/usr/local/rvm/rubies/ruby-${RUBY_VERSION}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/rvm/bin
RUN set -ex \
&& apt-get update && apt-get install -y curl \
&& gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
&& curl -sSL https://get.rvm.io | bash -s stable --ruby=${RUBY_VERSION}
@enjalot
enjalot / README.md
Last active June 17, 2020 08:18
WWSD #11: Mapbox-gl + d3 SVG overlay
@kechol
kechol / deploy.coffee
Last active September 23, 2019 20:45
hubot deploy script
# Description:
# Capistrano deployment from hubot
#
# Dependencies:
# Prepare capistrano config files in your repo.
#
# Configuration:
# None
#
# Commands: