Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Daniel Rodríguez Rivero danielo515

🏠
Working from home
View GitHub Profile
View os-version.js
// Name: os version
import "@johnlindquist/kit"
const version_info = (await $`sw_vers`).stdout
const version_lines = version_info.split("\n");
console.log(version_lines);
const version_number = version_lines[1].replace(/(?:.*?)(\d+)/,"$1");
copy(`macOS ${version_number}`);
@danielo515
danielo515 / Job.hx
Created December 11, 2022 10:53 — forked from kLabz/Job.hx
Lua test
View Job.hx
#if macro
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.TypeTools;
#end
@:remove // Doesn't seem to work on lua, eh
interface Job<TJobOpt:{}> {}
@:pure
@danielo515
danielo515 / restore_bin.js
Created November 14, 2020 14:10
Restore everything on google drive bin
View restore_bin.js
const recoverAll = (kind,iterator) => {
while (iterator.hasNext()) {
const next = iterator.next();
next.setTrashed(false);
Logger.log(kind + ": " + next.getName() + " RESTORED!");
}
}
function RecoverTrash() {
const folders = DriveApp.getTrashedFolders();
@danielo515
danielo515 / README.md
Last active August 31, 2018 16:04
Demonstrate how lab code coverage can get into a promise chain
View README.md

This is just an example to demonstrate how lab code coverage can get in the way

@danielo515
danielo515 / .travis.yml
Last active July 5, 2018 08:09 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
View .travis.yml
language: node_js
cache: yarn
node_js:
- "8.9.0"
branches:
only:
- master
script: # this are lerna-setup related
- npm run npm-setup
- npm run publish -- --yes --skip-git # lerna does not pick the correct repo url, so skip git
@danielo515
danielo515 / travis-ci-git-commit.bash
Created May 26, 2018 14:07 — forked from ddgenome/travis-ci-git-commit.bash
Make a commit on a branch in a Travis CI build, dealing with detached HEAD state safely
View travis-ci-git-commit.bash
#!/bin/bash
# function to make a commit on a branch in a Travis CI build
# be sure to avoid creating a Travis CI fork bomb
# see https://github.com/travis-ci/travis-ci/issues/1701
function travis-branch-commit() {
local head_ref branch_ref
head_ref=$(git rev-parse HEAD)
if [[ $? -ne 0 || ! $head_ref ]]; then
err "failed to get HEAD reference"
return 1
@danielo515
danielo515 / .hyper.js
Created September 13, 2017 11:36
Issue with npmRegistry
View .hyper.js
module.exports = {
config: {
hyperCommandGifs: {
disabledCommands: [ 'push' ]
},
npmRegistry: 'https://registry.npmjs.org/',
// default font size in pixels for all tabs
fontSize: 12,
@danielo515
danielo515 / create-gh-labels.js
Created July 12, 2017 07:10
Creates one label on github per package on a lerna repository
View create-gh-labels.js
#!/usr/bin/env node
'use strict';
/**
* This script creates labels at github.
* It depends on github-api and yargs packages, so make sure you have them installed
* on the environment you are going to run this.
* It accepts a github token or a combination of username and password for auth.
* The token can also be provided as an environment variable.
* To display help just run it with the -h or --help flag.
*
@danielo515
danielo515 / list_packages.js
Created July 12, 2017 06:44
List all packages under a lerna repository
View list_packages.js
'use strict';
const Fs = require('fs');
const ReadDir = Fs.readdirSync;
const Stat = Fs.statSync;
module.exports = (basePath) => {
const getAllPackages = () => ReadDir(basePath)
.map((d) => `${basePath}/${d}`)
View felicityFail.js
'use strict';
const Urls = ['www.google.es','www.google.com','www.google.it','www.google.de','www.google.no'];
const extension = (joi) => ({
base: joi.string(),
name: 'url',
language: {
metrics: 'needs to be one of {{urls}}'
},