Skip to content

Instantly share code, notes, and snippets.

View orlando's full-sized avatar
🦅

Orlando Del Aguila orlando

🦅
View GitHub Profile
@picatz
picatz / monitoring.hcl
Created December 12, 2020 19:43
A simple Nomad job file to deploy Prometheus and Grafana
job "metrics" {
datacenters = ["dc1"]
group "prometheus" {
network {
mode = "bridge"
}
service {
name = "prometheus"

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@orlando
orlando / mac-setup.md
Last active May 13, 2024 17:39 — forked from todc/mac-setup.md
Fresh Mac OS Setup

1. Run Software Update

Make sure everything is up to date in the App Store

2. Install Homebrew

  1. Open a terminal window and execute the Homebrew install script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active May 31, 2024 00:41
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch
@chubas
chubas / wordblender.md
Last active February 27, 2019 19:06
Word Blender

GDLJS Monthly Challenge #1 - Word Blender

This is an adaptation for the RubyQuiz #108 Word Blender, lots of spoilers there so best to look after!

Word Blender

The task for this month is to build a game based on the popular game TextTwist (and many other variations there are). It can be built as sophisticaded as you want, ranging from a command line game to a full featured GUI game if you want.

Rules

@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init

Right now, the issue with the arguments object is basically the following:

  • Arguments object is not actually allocated in optimized code. Element accesses and access to arguments.length are translated into loading from the stack.
  • This means, you can't touch the stack while the arguments object is alive, because touching the stack would break this optimization (this is why, function calls with the arguments object as a parameter are not allowed, it can't be pushed to the stack).

Rest parameters, currently, do not implement this optimization. So they will always allocate an array (and the array allocation is always done in C++, which is not ideal).

This means, if we can enable optimized code to use rest parameters (I had trouble getting Crankshaft to work, although TurboFan happily just builds the array like it's supposed to), there's no problem passing it to other functions or using methods from Array.prototype.

Of course, if we did avoid allocating an actual object, and just used the stack load strateg

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@vodolaz095
vodolaz095 / print.js
Last active August 30, 2023 20:47
Print for NodeJS using CUPS backend
var ipp = require('ipp'); //get it from there - https://npmjs.org/package/ipp - $npm install ipp
var request = require('request'); //get it from there - https://npmjs.org/package/request - $npm install request
var fs = require('fs');
function getPrinterUrls(callback) {
var CUPSurl = 'http://localhost:631/printers';//todo - change of you have CUPS running on other host
request(CUPSurl, function (error, response, body) {
if (!error && response.statusCode == 200) {
var printersMatches = body.match(/<TR><TD><A HREF="\/printers\/([a-zA-Z0-9-^"]+)">/gm);//i know, this is terrible, sorry(
var printersUrls = [];
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session