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": {
@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 / .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
@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
#!/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 / axios-set-base-path.js
Last active April 29, 2017 12:59 — forked from srph/set-base-path.js
axios: Configure the base path with interceptors
var axios = require('axios');
var join = require('url-join');
// https://github.com/sindresorhus/is-absolute-url/blob/master/index.js#L7
var isAbsoluteURLRegex = /^(?:\w+:)\/\//;
axios.interceptors.request.use(function(config) {
// Concatenate base path if not an absolute URL
if ( !isAbsoluteURLRegex.test(config.url) ) {
config.url = join('http://my-api.com', config.url);

Installation

1)

brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgents

2)

Replace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.

@danielo515
danielo515 / getBGImgURLsFromCSSs.js
Last active May 3, 2016 15:49 — forked from donut/getBGImgURLsFromCSSs.js
Builds a list of images found in the linked style sheets
window.npup = (function (doc) {
var sheets = doc.styleSheets;
var hash = {}, sheet, rules, rule, url, match;
// loop the stylesheets
for (var sheetIdx=0, sheetsLen=sheets.length; sheetIdx<sheetsLen; ++sheetIdx) {
sheet = sheets[sheetIdx];
// ie or w3c stylee rules property?
rules = sheet.rules ? sheet.rules : sheet.cssRules;
// loop the rules
for (var ruleIdx=0, rulesLen=rules.length; ruleIdx<rulesLen; ++ruleIdx) {
@danielo515
danielo515 / colors.py
Last active December 2, 2015 13:19 — forked from jossef/colors.py
python coloring for linux, based on this answer http://stackoverflow.com/a/26445590/3191896
def color(text, *user_styles):
styles = {
# styles
'reset': '\033[0m',
'bold': '\033[01m',
'disabled': '\033[02m',
'underline': '\033[04m',
'reverse': '\033[07m',
@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 September 6, 2015 17:28 — forked from chrisjacob/README.md
Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout - a step-by-step guide.

Intro

Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout.

IMPORTANT

If you plan on switching between different branches (e.g. git checkout master-experiment then revert back with git checkout master) you will loose your child folder from this tutorial (because it's in your .gitignore and is not part of your master branch).