Skip to content

Instantly share code, notes, and snippets.

View bjrmatos's full-sized avatar

BJR Matos bjrmatos

View GitHub Profile
@bjrmatos
bjrmatos / friday_deploy.txt
Last active March 25, 2023 17:57 — forked from mathroc/friday_deploy.txt
Friday Deploy ascii image
┐┌┐┌┐
┘└┘└┘\ₒ/
┐┌┐┌┐ ∕ Friday
┘└┘└┘ノ)
┐┌┐┌┐ deploy,
┘└┘└┘
┐┌┐┌┐ good
┘└┘└┘
┐┌┐┌┐ luck!
│││││
@bjrmatos
bjrmatos / gist:1dfd15059b5a9969a6a0
Last active May 24, 2022 19:21 — forked from georgeOsdDev/gist:9501747
Disable JS execution in console
// Disable javascript execution from console
// http://kspace.in/blog/2013/02/22/disable-javascript-execution-from-console/
var _z = console;
Object.defineProperty( window, "console", {
get : function(){
if( _z._commandLineAPI ){
throw "Sorry, Can't exceute scripts!";
}
return _z;
},
@bjrmatos
bjrmatos / .gitattributes
Created June 4, 2014 02:20
My default .gitattributes
# Git to autodetect text files and normalise their line endings to LF when they are checked into your repository.
* text=auto
#
# The above will handle all files NOT found below
#
# These files are text and should be normalized (Convert crlf => lf)
*.php text
*.css text
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- Virtual Directory Setup
assign virtualDirPath below a value like '/{path}'
Add below to your app code and then prepend routes with virtualDirPath
var virtualDirPath = process.env.virtualDirPath || ''; -->
@bjrmatos
bjrmatos / generate-consumer.js
Last active April 5, 2017 17:08
script to generate consumer id and secrets
'use strict';
var uuid = require('uuid'),
base64Url = require('base64-url'),
uuidBase62 = require('uuid-base62');
var consumer = {
key: uuidBase62.encode(uuid.v4()),
secret: base64Url.encode(uuid.v4().replace(/-/g, '')),
seed: uuid.v1().replace(/-/g, '')
@bjrmatos
bjrmatos / dotslashtaskdotjs.markdown
Last active May 19, 2016 11:53
task runner - only plain JS

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

@bjrmatos
bjrmatos / gist:84624daca5161e082d88
Created October 6, 2015 04:55 — forked from jorupp/gist:2af4d8583bd592b8331f
Lock all media queries in their current state
function process(rule) {
if(rule.cssRules) {
for(var i=rule.cssRules.length-1; i>=0; i--) {
process(rule.cssRules[i]);
}
}
if(rule.type == CSSRule.MEDIA_RULE) {
if(window.matchMedia(rule.media.mediaText).matches) {
rule.media.mediaText = "all";
} else {
@bjrmatos
bjrmatos / ref-fixed-string.js
Created September 25, 2015 03:52 — forked from TooTallNate/ref-fixed-string.js
Fixed length "String" type, for use in `ref-struct` type definitions.
var ref = require('ref');
module.exports = FixedString;
/**
* Fixed length "String" type, for use in Struct type definitions.
* Null-terminates by default.
* Throws an Error if there's not enough space available when setting a string.
*/
@bjrmatos
bjrmatos / AuthActions-Flux.js
Last active August 29, 2015 14:23
Flux React Auth Actions
'use strict';
var AppDispatcher = require('../AppDispatcher');
var ActionTypes = require('../constants/ActionTypes');
var AuthActions = {
signin: function(data) {
AppDispatcher.handleViewAction({
actionType: ActionTypes.AUTH_SIGNIN,
data: data