Skip to content

Instantly share code, notes, and snippets.

View r4j4h's full-sized avatar

Jasmine Hegman r4j4h

View GitHub Profile
@bengfarrell
bengfarrell / randomcoords.cpp
Last active April 17, 2020 16:30
Random Coordinates C++ Node.JS AddOn
#include <node.h>
#include <v8.h>
#include <stdio.h>
#include <stdlib.h>
using namespace v8;
Handle<Value> getRandomCoords2D(const Arguments& args) {
HandleScope scope;
@valmat
valmat / vlm.utils.destructing.d
Last active June 1, 2020 18:20
variable destructuring; array to variables list; destructuring assign. Traversable, Tuple
//
// May destructing variables for itarable types and tuples
//
module vlm.utils.destructing;
import std.range : empty, popFront, front;
import std.traits : isIterable;
import std.typecons : Tuple, tuple, isTuple;
import std.functional : forward;
@penguinbroker
penguinbroker / gist:1378258
Created November 19, 2011 01:15
Paper.js hit test
hitTool = new paper.Tool();
hitTool.activate();
hitTool.onMouseDown = function (event) {
hitOptions = {
segments: true,
stroke: true,
fill: true,
tolerance: 5
};
hitResult = paper.project.hitTest(event.point, hitOptions);
@boennemann
boennemann / README.md
Last active March 30, 2021 23:00
Pushing new releases of a legacy version with semantic-release

If you have a package where a lot of people are still using a legacy version of it you might want to keep pushing (security-)fixes to that "branch".

Let's say the "latest" version of your package is "5.4.0", but there is as significant amount of people still using "4.7.4" – the last version you released before doing "5.0.0".

You found a critical bug in "5.4.0" and push it as out as "5.4.1", but it applies to "4.7.4" as well and so you want to do "4.7.5".

Assuming you have semantic-release already set up, you can follow these steps to get that "4.7.5" legacy support release out.

  1. Go to the relevant commit: git checkout v4.7.4
  2. Create a new branch from it: git checkout -b 4.x (You can choose any branch name, just make sure to use the same in step 3)
@henrysher
henrysher / reinvent.md
Last active July 9, 2021 07:38
link for reinvent slides
@mattbaker
mattbaker / README
Created December 22, 2011 06:02
SVG to PNG render with Node and D3.js
This example expects to have d3.min.js and d3.layout.min.js in the same directory as pie.js and pie_serv.js.
Run with node pie_serv.js
module thrift_vibe;
import std.range;
import thrift.codegen.base : isService;
import thrift.protocol.base;
import thrift.protocol.processor;
import thrift.transport.base;
import thrift.util.cancellation;
import vibe.core.log;
import vibe.core.net;
@joost
joost / resize_boot2docker.sh
Last active December 14, 2022 07:34
Resize boot2docker VirtualBox image
# Steps we will take:
# 1. Change boot2docker image type (this will take long)
# 2. Resize image
# 3. Resize partion (using GParted)
#
# Also see: https://docs.docker.com/articles/b2d_volume_resize/
# Stop boot2docker
boot2docker stop
@markerikson
markerikson / nodeenvDiscussion.md
Last active January 9, 2023 15:24
Summary of process.env.NODE_ENV and its use with Webpack

[02:06 PM] acemarke: @Steven : a couple other thoughts on the whole NODE_ENV thing. First, per my comments, it really is a Node concept. It's a system environment variable that Node exposes to your application, and apparently the Express web server library popularized using its value to determine whether to do optimizations or not
[02:08 PM] acemarke: Second, because of its use within the Node ecosystem, web-focused libraries also started using it to determine whether to they were being run in a "development" environment vs a "production" environment, with corresponding optimizations. For example, React uses that as the equivalent of a C #ifdef to act as conditional checking for debug logging and perf tracking. If process.env.NODE_ENV is set to "production", all those if clauses will evaluate to false.
Third, in conjunction with a tool like UglifyJS that does minification and removal of dead code blocks, a clause that is surrounded with if(process.env.NODE_ENV !== "development")

@MartinNowak
MartinNowak / BvSshServer-Settings.wst
Last active April 14, 2023 03:52
Preparing a Win7x64 base box.