Skip to content

Instantly share code, notes, and snippets.

View danielo515's full-sized avatar
🏠
Working from home

Daniel Rodríguez Rivero danielo515

🏠
Working from home
View GitHub Profile
@danielo515
danielo515 / tsconfig.json
Created December 14, 2023 11:37 — forked from MrFunctor/tsconfig.json
tsconfig.json with common fp-ts namespace imports configured with @unsplash/ts-namespace-import-plugin
{
"compilerOptions": {
"plugins": [
{
"name": "@unsplash/ts-namespace-import-plugin",
"namespaces": {
"A": {
"importPath": "fp-ts/Array"
},
"B": {
// Name: today-timestamp
// Description: inserts the today date (not including time) formatted as YYYY/MM/DD
// Snippet: !tday
import '@johnlindquist/kit';
function twoDigits(number: number): string {
return number.toString().padStart(2, '0');
}
// Name: url encode
import "@johnlindquist/kit"
const text = await arg("What do you want to encode");
const encoded = encodeURIComponent(text)
await copy(encoded);
// 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
#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
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();
// iMacro CheatSheet - Command Reference
// http://wiki.imacros.net/Command_Reference
// iMacros supports 3 types of variables:
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro.
// * Built-in variables. They contain certain values set by iMacros.
// * User-defined variables. They are defined in-macro using the SET command.
@danielo515
danielo515 / auto-deploy.md
Created September 24, 2015 19:03 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@danielo515
danielo515 / README.md
Last active August 31, 2018 16:04
Demonstrate how lab code coverage can get into a promise chain

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
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