Skip to content

Instantly share code, notes, and snippets.

View gustin's full-sized avatar
🦁
Happy

gustin gustin

🦁
Happy
View GitHub Profile
>>> > I think the default is we assume reasonably powerful general purpose
>>> > computers,
>>>
>>> Constrained devices are indeed hard to design for (and there are many
>>> dimensions of constraint - code size, memory, storage, battery, etc.). I
>>> wouldn't necessarily argue for supporting Class 0 devices (which
>>> according to RFC 7228 are "very constrained sensor-like motes"), but
>>> Class 2 devices (which are "fundamentally capable of supporting most of
@gustin
gustin / rename.sh
Created April 10, 2019 01:08 — forked from nerdyworm/rename.sh
rename a phoenix project
#!/bin/bash
set -e
CURRENT_NAME="CurentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"
@gustin
gustin / regexCheatsheet.js
Created January 15, 2019 14:39 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
Verifying my identity on Peepeth.com 0x3ab8e9aa277b3bd3a10713b3437b2cf2cd392bc4
@gustin
gustin / Elixir
Created June 28, 2017 14:36 — forked from ashleyconnor/Elixir
Elixir Socket Example
defmodule SocketPlayground do
def listen(port) do
listen(port, &handler/1)
end
def listen(port, handler) do
IO.puts "listen"
Socket.TCP.listen!(port, packet: :line)
|> accept(handler)
end

Keybase proof

I hereby claim:

  • I am gustin on github.
  • I am gustin (https://keybase.io/gustin) on keybase.
  • I have a public key ASA73upxdy2mPTZ0p1i580Tf1TRr59bVebi_YBbk4_tGvAo

To claim this, I am signing this object:

@gustin
gustin / gist:02160d959a39ed4cf6f9d200115bc35b
Created December 19, 2016 16:57 — forked from alex-zige/gist:5795358
Rails Rspec API Testing Notes

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>purpose.js</title>
<script src="./purpose.min.js"></script>
<link rel="stylesheet" href="./purpose.css">
<script>
"use strict";
var purpose = new Purpose({
<script>
new Purpose({ apiKey: "oxfam-ec1553f5464341b544d053e20783e732",
url: "//api.staging.purpose.com/en-au" }).attach();
</script>
<div data-prps-generator="action-sequence"
data-prps-movement="australia"
data-prps-action-sequence="b&l_petition_sequence_1">
</div>
@gustin
gustin / gist:aa7c87c5baad66638fb4
Last active August 29, 2015 14:15
Oxfam Belgium
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>purpose.js</title>
<script src="./purpose.min.js"></script>
<link rel="stylesheet" href="./purpose.css">
<script>
"use strict";
var purpose = new Purpose({