Skip to content

Instantly share code, notes, and snippets.

View RayBenefield's full-sized avatar

Ray Benefield RayBenefield

View GitHub Profile
@stueccles
stueccles / array.verse
Last active July 10, 2025 14:49
A Verse module that adds useful functions to Verse Arrays including Map, Reduce etc.
using { /Verse.org/Random }
Array<public> := module:
# Makes an `array` with only unique elements
(Input:[]t where t:subtype(comparable)).Unique<public>()<transacts>:[]t =
var UniqueArray : []t = array{}
for (Value : Input):
if (UniqueArray.Find[Value] > -1) {}
else:
@Terbau
Terbau / AccountMutation.graphql
Created February 29, 2020 18:15
Epic GraphQL Requests
mutation AccountMutation($twoFactorRequest: TwoFactorRequest!, $type: [String]!) {
Account {
# update two factor authentication
updateTwoFactorAuthentication(twoFactorRequest: $twoFactorRequest) { #Type: AccountMutationStatus
success #Type: Boolean
}
# Remove authentication method
removeThirdPartyLink(type: $type) { #Type: AccountMutationStatus
success #Type: Boolean
}
@threepointone
threepointone / 0 basics.md
Last active March 21, 2023 01:53
css-in-js

A series of posts on css-in-js

0. styles as objects

First, an exercise. Can we represent all of css with plain data? Let's try.

let redText = { color: 'red' };
@geoffreydhuyvetters
geoffreydhuyvetters / react_fiber.md
Last active August 15, 2024 15:17
What is React Fiber? And how can I try it out today?
@madox2
madox2 / vim_eslint_fix.vim
Created October 12, 2016 16:22
Function which runs eslint --fix and saves the buffer. It is mapped to :W command
function ESLintFix()
write
silent execute "!./node_modules/.bin/eslint --fix %"
edit! %
redraw!
endfunction
command W call ESLintFix()
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active July 12, 2025 21:04
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@mafayaz
mafayaz / simpleRestfulHttpServerInPython
Created July 5, 2016 11:57
Writing Simple HTTP Server in Python (With REST and JSON)
There are many already existing powerful http servers that can be used in python e.g. gevent, twisted web server. However, they are a bit complex to use and you cannot start them in a thread other than the main thread.
Here is a sample of basic http server using "BaseHTTPRequestHandler". The example exposed two rest interfaces:
To ingest records into the web server
To retrieve already ingested records from the web server
The records are assumed to be JSON based, however, any type of records can be ingested.
[sourcecode language="python" wraplines="false" collapse="false"]
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
@josh-padnick
josh-padnick / fish-agent.sh
Last active June 20, 2025 19:55
Run ssh-agent via fish shell
#!/bin/bash
#
# Convert ssh-agent output to fish shell
#
eval "$(ssh-agent)" >/dev/null
echo "set SSH_AUTH_SOCK \"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK"
echo "set SSH_AGENT_PID \"$SSH_AGENT_PID\"; export SSH_AGENT_PID"
@btroncone
btroncone / rxjs_operators_by_example.md
Last active March 30, 2025 21:26
RxJS 5 Operators By Example