Skip to content

Instantly share code, notes, and snippets.

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

Javier Carrillo Milla stringparser

🏠
Working from home
View GitHub Profile
@stringparser
stringparser / README.md
Last active November 2, 2021 09:43
webpack + typescript + react config #blog
@stringparser
stringparser / thy-minimal-docs.md
Last active January 19, 2018 10:33
Documentation thoughts for non-library projects

Documentation

Ideas about documenting enough for non-library projects.

Motivation

The aim of this document is to give rules to follow in order to make a project understandable from a producer and consumer point of view. The idea is to have a simple setup where code self-documents itself whenever possible. When this is not possible we will give options on how to go about it.

Where to start?

@stringparser
stringparser / git-extras-plus.sh
Created December 19, 2017 12:35
prune this, grune that
alias grune='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
alias drune='docker rm $(docker ps -aq)'
@stringparser
stringparser / npm-boot.sh
Last active October 19, 2019 07:43
boostrap nested npm modules
# boostrap nested npm modules installation
npm-boot() {
local INIT_DIR=$PWD
# go through all packages and install their dependencies
for package in `ls ./**/package.json | grep -v node_modules`
do
cd $INIT_DIR
cd $(dirname $package)
echo "Installing modules for $PWD"
@stringparser
stringparser / url.sh
Created September 3, 2016 10:38
find urls in all css files
grep -oh 'url[^)]*' ./**/*.css | grep -o "[/.][^\\'\\\"?#]*"
@stringparser
stringparser / background.js
Created August 9, 2016 21:11 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@stringparser
stringparser / _.isEqual.coffee
Created June 26, 2016 08:56
smaller lodash.isEqual
__toString = Object.prototype.toString
isEqual = (a, b) ->
if arguments.length < 2
return false # cannot compare
typeA = typeOf(a)
typeB = typeOf(b)
# falsy values can be compared by reference except for NaN
@stringparser
stringparser / oneToCloneThemAll.sh
Created July 31, 2015 16:59
Clone all private repos of an organization
curl -u <token>:x-oauth-basic -s https://api.github.com/orgs/<orgName>/repos | node -e '
var repos="";
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", function(data){
repos += data;
});
process.stdin.on("end", function(){
JSON.parse(repos).forEach(function(repo){
require("child_process").spawn("git", ["clone", repo.html_url], {stdio: "inherit"});
var _ = require('underscore');
var Backbone = require('backbone');
var cheerio = require('cheerio');
var request = require('request');
Backbone.ajax = function(options) {
options.json = true;
return request(options, function(error, result) {
if (error) {
@stringparser
stringparser / texsvg.hs
Last active August 29, 2015 14:25 — forked from lierdakil/texsvg.hs
Pandoc filter to convert math to inline svg using latex and dvisvgm
import Text.Pandoc.JSON
import System.Directory
import System.FilePath ((</>))
import qualified Data.Hash.MD5 as MD5
import System.IO.Temp
import System.Process
import Control.Monad (unless)
main :: IO ()
main = toJSONFilter mathToSvg