Skip to content

Instantly share code, notes, and snippets.

# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@cobyism
cobyism / gh-pages-deploy.md
Last active November 11, 2024 00:02
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@jeroen
jeroen / shit.md
Last active March 4, 2022 07:18
Getting shit to work

Getting shit to work

Disclaimers

  • No authority
  • Official reference is writing r extentions (joke extentions)
  • If you thought writing regular r packages was tricky, hold on
library(dplyr, warn.conflicts = FALSE)
library(gapminder)
probs <- c(0.1, 0.5, 0.9)
gapminder %>%
group_by(continent) %>%
summarise(
probs = probs,
across(is.numeric & !year, ~ quantile(.x, probs))
)
@Dan-Piker
Dan-Piker / Moebius3d
Last active March 27, 2024 08:06
Moebius transformations in 3d
//Moebius transformations in 3d, by reverse stereographic projection to the 3-sphere,
//rotation in 4d space, and projection back.
//by Daniel Piker 09/08/20
//Feel free to use, adapt and reshare. I'd appreciate a mention if you post something using this.
//You can also now find this transformation as a component in Grasshopper/Rhino
//I first wrote about these transformations here:
//https://spacesymmetrystructure.wordpress.com/2008/12/11/4-dimensional-rotations/
//If you want to transform about a given circle. Points on the circle and its axis stay on those curves.
//You can skip these 2 lines if you want to always use the origin centred unit circle.
@jscarto
jscarto / Blue Fluorite Palette
Last active September 24, 2020 06:03
Perceptually linear color palette based on a blue fluorite crystal (https://twitter.com/GeologyTime/status/1308406136283049984)
blue_fluorite = ['#291b32', '#2a1b34', '#2b1b34', '#2d1c36', '#2f1c38', '#301c39', '#301d3a', '#321d3b', '#331d3d', '#351d3f', '#351e40', '#371e41', '#381e43', '#3a1e45', '#3b1f45', '#3c1f46', '#3e1f48', '#3f1f4a', '#401f4c', '#42204d', '#43204e', '#44204f', '#462051', '#472052', '#482054', '#4a2056', '#4a2157', '#4c2158', '#4e215a', '#4f215b', '#50215d', '#52215e', '#532160', '#552162', '#552263', '#562264', '#582265', '#592267', '#5b2268', '#5c226b', '#5e226c', '#5f226e', '#60226f', '#622271', '#632272', '#642274', '#662276', '#672277', '#692278', '#6a227a', '#6c227b', '#6e227d', '#6e237e', '#6f247f', '#702480', '#712581', '#722681', '#732683', '#742783', '#752884', '#762985', '#772987', '#792a87', '#792b88', '#7a2c89', '#7b2c8a', '#7c2d8a', '#7d2d8c', '#7e2e8d', '#7f2f8d', '#80308e', '#813190', '#823191', '#833292', '#843292', '#863393', '#863494', '#873595', '#893596', '#8a3697', '#8b3798', '#8b3899', '#8c389a', '#8e399b', '#8e3a9c', '#8f3b9c', '#8f3d9d', '#8f3e9e', '#903f9e', '#90419e', '#90439f', '#9044
@prologic
prologic / LearnGoIn5mins.md
Last active November 5, 2024 02:14
Learn Go in ~5mins