Skip to content

Instantly share code, notes, and snippets.

View dvins's full-sized avatar
🚀
Ad Astra!

David Vins dvins

🚀
Ad Astra!
View GitHub Profile
@yeganemehr
yeganemehr / semanticVersioningConversion.js
Last active March 26, 2025 21:32 — forked from dislick/semanticVersioningConversion.js
Convert Semantic Versioning String to Integer in ES6
/**
* Convert a sematic versioning string into an 32-bit integer.
*
* Make sure the input string is compatible with the standard found
* at semver.org. Since this only uses 10-bit per major/minor/patch version,
* the highest possible SemVer string would be 1023.1023.1023.
* @param {string} version SemVer string
* @return {number} Numeric version
*/
const convertVersionToInt32 = function(version) {
@andreialecu
andreialecu / README.md
Last active April 6, 2023 17:44
Sentry NestJS GQL instrumentation
@click2install
click2install / DateTime.ts
Created November 21, 2021 08:07
[DateTime] - A GraphQL ScalarType for Luxon DateTime
import type { GraphQLScalarTypeConfig } from "graphql";
import { GraphQLScalarType } from "graphql";
import { DateTimeResolver } from "graphql-scalars";
import { DateTime } from "luxon";
export const GraphQLDateTimeConfig: GraphQLScalarTypeConfig<DateTime, DateTime> =
{
name: "DateTime",
description: "An ISO8601 date-time string represented by a Luxon DateTime instance.",
@philippefutureboy
philippefutureboy / RollupOrderedDrilldownTable.jsx
Created January 14, 2020 01:07
Cube.js Client Wrapper Gist
import React from 'react';
import * as R from 'ramda';
import cube from '../../utils/cube';
import TableContainer from './Table';
import { getAllResultSetDataFromResultSetDict } from '../../utils/cube.utils';
import {
sortByRowRollupValue,
sumColumnRollupRecordsToGrandTotalRecord,
} from '../helpers/rollupOrderedPatientAgeGroupDrilldownTableHelpers';
@skyzyx
skyzyx / homebrew-gnubin.md
Last active April 13, 2025 03:08
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@bsamuel-ui
bsamuel-ui / serverless-deploy-user.yaml
Last active June 5, 2019 17:20
Cloudformation template to deploy permissions for deploying a serverless project.
AWSTemplateFormatVersion: 2010-09-09
Description: >
Constructs a managed IAM policy to deploy a serverless project.
This template assumes the stack is being deployed in the current region and account.
You can then attach this policy to other IAM objects, such as users or roles.
Based on the work done in: https://github.com/serverless/serverless/issues/1439
@dislick
dislick / semanticVersioningConversion.js
Last active March 26, 2025 21:31
Convert Semantic Versioning String to Integer in ES6
/**
* Convert a sematic versioning string into an 32-bit integer.
*
* Make sure the input string is compatible with the standard found
* at semver.org. Since this only uses 10-bit per major/minor/patch version,
* the highest possible SemVer string would be 1023.1023.1023.
* @param {string} version SemVer string
* @return {number} Numeric version
*/
const convertVersionToInt32 = function(version) {
@weavenet
weavenet / delete_all_object_versions.sh
Created May 4, 2015 05:21
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
public class TravisSpecs {
[Test]
public void WhenTravisGetsIntoAnotherFight() {
new ScenarioBuilder().
Given(TheStoryOfWhatHappenedToTravis())
When(TravisGetsInToANewFight()).
Then(HeRuns()).
Assert();
}