Skip to content

Instantly share code, notes, and snippets.

View marcoonroad's full-sized avatar
🦋
the Future() has been CANCELLED and we .Restart() the DEAD Event[] from the past

Marco Aurélio da Silva marcoonroad

🦋
the Future() has been CANCELLED and we .Restart() the DEAD Event[] from the past
View GitHub Profile
@robotlolita
robotlolita / purr.md
Last active May 10, 2017 20:39
Why Purr is awful

You appear to be advocating a new:

  • functional
  • imperative
  • object-oriented
  • procedural
  • stack-based
  • "multi-paradigm"
  • lazy
  • eager
  • statically-typed
@caseywatts
caseywatts / bookmarkleting.md
Last active October 12, 2025 10:55
Making Bookmarklets

This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Making Bookmarklets

I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!

A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.

@mark-adams
mark-adams / aes_example.cs
Created December 12, 2014 15:02
AES String Encryption (CBC) Example Code for C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace aes_example
{
using System;
@jschoch
jschoch / stuff.ex
Created April 9, 2015 14:22
struct encoding and decoding nested structs with poison
defmodule MyTime do
defstruct stamp: {0,0,0}
defimpl Poison.Encoder, for: MyTime do
def encode(%MyTime{} = t,options) do
list = Tuple.to_list(t.stamp)
Poison.Encoder.Map.encode(%MyTime{stamp: list},options)
end
end
defimpl Poison.Decoder, for: MyTime do
def decode(s,options) do
@o3bvv
o3bvv / console
Last active September 6, 2023 04:05
SSSHHH! Testing Python SSH client with auth via private key
# Install our dependencies
$ pip install -r <(wget -O- http://bit.ly/ssh_test_requirements)
# Generate key pair without password
$ ssh-keygen -t rsa -C "user@unicorn"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/alex/.ssh/id_rsa): user.key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
@col
col / setup_elixir_app_on_travis_ci.md
Last active July 4, 2020 17:46
Configure Elixir app on Travis CI

Configure Elixir app on Travis CI

Setup Build

  1. Create .travis.yml file in the base dir
  2. Enter the following content:
language: elixir
elixir:
 - 1.2
@marcoonroad
marcoonroad / rectypes.eff.ml
Last active September 26, 2020 16:29
Example of fold/unfold operations...
(* type-level recursion with fold/unfold *)
(* $ eff --effects -l rectypes.eff *)
(* there's an unique isomorphism between fold and unfold such that:
fold :: ...1 Unfix (...2 Fix (func) ...3) ...4 <=> ...1 Fix (func) ...4 :: unfold
where func = \fix -> ...2 fix ...3
so, conceptually:
@0mkara
0mkara / Ethereum_private_network.md
Last active July 29, 2025 14:38
Ethereum private network configuration guide.

Create your own Ethereum private network

Introduction

Used nodes:

Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
Linux localhost.localdomain 4.14.5-200.fc26.x86_64 #1 SMP Mon Dec 11 16:29:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@cure53
cure53 / scriptlet.md
Last active August 23, 2025 07:29
The Scriptless Scriptlet - Or how to execute JavaScript from CSS in MSIE11 without using Scripts

The Scriptless Scriptlet

Or how to execute JavaScript from CSS in MSIE11 without using Scripts

Stop! This text is only interesting for you if you...

  • Like popping alerts in weird situations
  • Miss CSS expressions as much as we do
  • Have an unhealthy obsession for markup porn

Introduction

#!/bin/bash
echo ECS_CLUSTER=your_ecs_cluser_name > /etc/ecs/ecs.config
INSTANCE=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
hostname $INSTANCE
sed -i.bak "s/\\(HOSTNAME=\\).*/\\1$INSTANCE/" /etc/sysconfig/network
# https://aws.amazon.com/blogs/compute/using-amazon-efs-to-persist-data-from-amazon-ecs-containers/
yum -y install jq