Skip to content

Instantly share code, notes, and snippets.

View MarceloAlves's full-sized avatar
🔥
Breaking things

Marcelo Alves MarceloAlves

🔥
Breaking things
View GitHub Profile
require 'open-uri'
list = open('https://gist.githubusercontent.com/coderd00d/54215798871d0c356cfb/raw/5eaeefb59a46bbede467bc3d1ce58f5462f78166/186%20easy').read
candy = Hash.new{ |k,v| k[v] = 0 }
list.split(/\n/).each{ |v| candy[v] += 1 }
candy.each do |k,v|
p "#{k} - #{v} - #{format('%.2f%', v.to_f/1000 * 100)}"
@MarceloAlves
MarceloAlves / curator.txt
Created January 29, 2015 05:47
Clear Marvel logs older than 1 day from ElasticSearch
curator delete --older-than 1 --prefix .marvel- --timestring %Y.%m.%d
@MarceloAlves
MarceloAlves / decode.rb
Created March 21, 2013 18:42
Check session values
require 'rack'
puts Rack::Session::Cookie::Base64::Marshal.new.decode(ARGV[0])
files:
/etc/nginx/conf.d/proxy.conf:
content: |
client_max_body_size 25M;
server_names_hash_bucket_size 128;
upstream backend {
server unix:///var/run/puma/my_app.sock;
}
{
"key": "MEDPAC",
"name": "Medpac",
"description": "[H3]Medpac[h3]Slightly larger and infinitely more advanced than a standard emergency medpac, the FastFlesh is a good example of a medpac carried by a trained medic. The medpac carries instruments for emergency field surgery, a better diagnostic computer and mediscanner, advanced synth-nutrient replicators for sustaining a patients vital nutrients, spray splints, and counter-radiation and biological poison drugs.[P]This medpac allows the user to perform relatively complicated medical procedures in the field, and can rival the infirmaries on smaller starships. It allows characters to attempt to heal others using Medicine checks without penalty as described on page 219, and additionally grants a[BOOST]on all attempts. In addition. the internal stim storage grants the user the equivalent of one stimpack per scene (although the GM can rule the device has run out of stims if the supplies are used continuously.[P][B]Models Include:[b] Athakam MedTech F
Caldeirao - Volcano crater
Gruta Ponta do Marco - Cave
import { createSlice as createSliceToolkit } from '@reduxjs/toolkit'
export interface StateSlice<T = any> {
data: T
isFetching: boolean
receivedAt: number | null
error: boolean
errorMessage: string | null
errorCode: number | null
}
'use strict';
const remove_suffix = '.example.com'; // TODO: Update domain name
const origin_hostname = 'example-bucket'; // TODO: Update bucket name
module.exports.cloudfront = (event, context, callback) => {
const request = event.Records[0].cf.request;
const headers = request.headers;
const host_header = headers.host[0].value;
@MarceloAlves
MarceloAlves / machine.js
Last active April 30, 2020 06:01
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@MarceloAlves
MarceloAlves / machine.js
Last active May 1, 2020 07:01
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions