Skip to content

Instantly share code, notes, and snippets.

select d.github_source, e.* from
(select a.github_source, count(*) as count FROM
(SELECT DISTINCT github_source FROM assignments) as sources
INNER JOIN assignments as a ON sources.github_source = a.github_source group by a.github_source) as d
inner join assignments as e on d.github_source = e.github_source where d.count > 1;
results = ActiveRecord::Base.connection.execute(
'select d.github_source, e.* from
(select a.github_source, count(*) as count FROM
(SELECT DISTINCT github_source FROM assignments) as sources
results = ActiveRecord::Base.connection.execute(
'select d.github_source, e.* from
(select a.github_source, count(*) as count FROM
(SELECT DISTINCT github_source FROM assignments) as sources
INNER JOIN assignments as a ON sources.github_source = a.github_source group by a.github_source) as d
inner join assignments as e on d.github_source = e.github_source where d.count > 1;'
)
with_content_ids = []
no_content_ids = []
curl http://elasticsearch05.fe.flatironschool.com:9200/users_development/_search?pretty -d '{
"query":{
"dis_max":{
"queries":[
{
"match":{
"github_username.analyzed":{
"query":"adam",
"operator":"and",
"boost":10,
#!/usr/local/rvm/rubies/ruby-2.3.3/bin/ruby
require 'net/http'
require 'json'
MONITORED_HOSTGROUPS = {
ironboard: 'Web Servers',
postgres: 'Database',
flatchat: 'Chat',
ide: 'IDE'
@adamjonas
adamjonas / gist:8da156886ffa414541eaa43c0c5074ca
Created June 27, 2019 19:58
Privacy Leaks in Lightning
1) How can Gossip protocol be exploited to leak privacy?
2) How do BOLT 11 strings potentially leak privacy?
3) What is the minimal amount of info watchtowers need to know to work?
4) How can we minimize what is broadcasted to the base layer and how can the base layer leak our privacy?
@adamjonas
adamjonas / gist:a4399dd277892dfb0654473a6fdfb6f3
Created June 27, 2019 20:08
categorization of first principle issues
Fungibility/Privacy:
Scalability:
Trustlessness/Decentralization:
@adamjonas
adamjonas / irssi.md
Created August 7, 2019 20:05 — forked from tasdikrahman/irssi.md
irssi cheatsheet
@adamjonas
adamjonas / generating_a_patchset.md
Last active June 9, 2020 17:45
Generate a patchset

Error:

>>> [do_build] Command failed: git apply /Users/jonas/bitcoin-dir/bitcoin-maintainer-tools/patches/stripbuildinfo.patch
>>> [do_build] Could not apply patch to strip build info. Probably it needs to be updated

Checkout the patchset from the last patch:

git checkout 'master@{aug 1}'

@adamjonas
adamjonas / high_priority.md
Last active December 19, 2019 01:17
net_processing and validation PRs
@adamjonas
adamjonas / verification_v_computation.md
Created August 8, 2020 15:59
verification and computation

Q: In this video, John Newbery talks about verification vs computation, and he bring it up as a big reason why he thinks bitcoin can scale but is skeptical about ethereum. I think I get the general idea of what he’s saying but I might be missing something.

Is there a qualitative difference between verification and computation? And is it the fact that ethereum is capable of performing arbitrary computation that makes the whole thing difficult to scale, or is it that specifically smart contracts that require arbitrary computation won’t be able to scale (as in those contracts would be very expensive to run).

A: There is a big difference between verification and computation.

For instance:

  1. given the prime number 11,121,415,581,673,924,441, compute its prime factorisation.
  2. given the prime number 11,121,415,581,673,924,441, verify that 3,226,079,203 and 3,447,347,347 are its factors.