Skip to content

Instantly share code, notes, and snippets.

const imageUrl = `https://res.cloudinary.com/timz/video/upload/so_1/v1/${flower.url}.jpg`;
const videoUrl = `https://res.cloudinary.com/timz/video/upload/v1/${flower.url}.webm`;
export const flower = {
uid: '6afc1ac2dbb34d7899b218ff340b4cfb',
title: 'Milestone: 100 happy users',
user: '63',
createdAt: '2020-07-14T08:03:40.533057+00:00',
updatedAt: '2020-07-14T10:34:21.878942+00:00',
resourceType: null,
@darkua
darkua / task.erl
Created August 8, 2016 00:53
get a list, and jump n[i] positions to next element until out of index, In a time complexity of O(N)
-module(var1).
-author("Sergio Veiga <sergioveiga@gmail.com>").
% get a list, and jump n[i] positions to next element until out of index
% In a time complexity of O(N)
% Has the graph loops?
% How many jumps to destination?
-export([
calculate_jumps/1,
@darkua
darkua / 0_reuse_code.js
Last active April 15, 2016 14:46
Here are some things you can do with Gists in GistBox.
Server Software: nginx
Server Hostname: apply.hsf.net
Server Port: 443
SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Document Path: /sassy/v2/auth
Document Length: 32 bytes
Concurrency Level: 555
Time taken for tests: 58.904 seconds
Sergios-MacBook-Pro:redgage_data sergioveiga$ ./start-dev.sh
Erlang R14B01 (erts-5.8.2) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.2 (abort with ^G)
(dev@127.0.0.1)1> 2012-09-10 19:08:16.914 [info] <0.6.0> Application lager started on node 'dev@127.0.0.1'
2012-09-10 19:08:16.952 [info] <0.6.0> Application sasl started on node 'dev@127.0.0.1'
2012-09-10 19:08:16.987 [info] <0.6.0> Application crypto started on node 'dev@127.0.0.1'
2012-09-10 19:08:16.993 [info] <0.6.0> Application riak_sysmon started on node 'dev@127.0.0.1'
** Found 0 name clashes in code paths
2012-09-10 19:08:17.151 [info] <0.6.0> Application webmachine started on node 'dev@127.0.0.1'
@darkua
darkua / node_client.js
Created November 28, 2011 17:31
ManyBots APi, nodejs authtoken example
var myLib = require('./urlReq');
var Manybots = {
base_uri : 'https://www.manybots.com',
req_params : {
auth_token : 'YOUR API TOKEN :)',
page : 1,
per_page : 20
},
filter_activities : function(filters){
%%--------------------------------------------------------------------
%% @spec build_challenge(Key1::list(),Key2::list(),Key3::binary()) -> binary()
%% @doc Builds the challenge needed by WebSocket Handshake 76
%% @end
%%--------------------------------------------------------------------
build_challenge(Key1,Key2,Key3)->
Ikey1 = get_key_number(Key1,[]),
Ikey2 = get_key_number(Key2,[]),
proplists_get_value(Key,[H|_] = List) when erlang:is_tuple(H) ->
case lists:keyfind(Key,1,List) of
{K,V} when K =:= Key ->
V;
_->
undefined
end;
proplists_get_value(_,[])->
undefined;
%%%-------------------------------------------------------------------
%%% File: unshort_srv.erl
%%% @author Sergio Veiga <> []
%%% @copyright 2010 Sergio Veiga
%%% @doc A simple Server to retrieve the original url from a short one
%%%
%%% @end
%%%
%%% @since 2010-02-21 by Sergio Veiga
%%%-------------------------------------------------------------------
-module(spawn_example).
-export([
start/0,
loop/0
]).
start()->
Pid = spawn(fun()->?MODULE:loop() end),
register(bot,Pid).
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Wikipedia PT</ShortName>
<Description>Wikipedia Artigos Portugueses</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">http://en.wikipedia.org/favicon.ico</Image>
<Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&amp;client=firefox&amp;hl={moz:locale}&amp;q={searchTerms}"/>
<Url type="text/html" method="GET" template="http://pt.wikipedia.org/w/index.php">
<Param name="search" value="{searchTerms}"/>
</Url>