Skip to content

Instantly share code, notes, and snippets.

View ColdSauce's full-sized avatar
💭
work work work work

Stefan Aleksic ColdSauce

💭
work work work work
View GitHub Profile
my-nhs-pass.com
nhs.your-digital-pass.com
santander.secure-auth-acc.com
santander.secured-auth-login.com
santander.online-recipient.com
your-digital-pass.com
online-nhs-pass.com
santander.auth-recipient.com
secure-auth-acc.com
my.nhs-get-pass.com
@ColdSauce
ColdSauce / gist:347d147c17ce9c24482620289702ca47
Created February 25, 2018 20:32
Testing discovery swarm
var swarm = require('discovery-swarm')
var sw = swarm()
sw.listen(8048)
sw.join('dat://85471abf77e6f387e18184fd72d20b8b401add3fb1162cb941b4b868664928c2') // can be any id/name/hash
sw.on('connection', function (connection) {
console.log('found + connected to peer')
})
[{"path":"Users/coldsauce/Documents/website","hash":"Qmb3R27q7Ka4ZuNFwJGQtzU9YMEEPeSTe1yctGEDZ9rqFs","size":60},{"path":"Users/coldsauce/Documents","hash":"Qma9ZpSoh4MAHsd8nVFyVcuvJ4fSenbnz3RzTd7DGeh8Fr","size":113},{"path":"Users/coldsauce","hash":"QmXiK1RHuGicXCeumY4pQgYK7M5dXiruGEvw7iojmdBbfU","size":168},{"path":"Users","hash":"QmW7mZHzKG9ZKxCWpCGpoUjDsJtLNTv7hRf5D4kCQW4xxp","size":224},
{"path":"/Users/coldsauce/Documents/website/hacker.png",
"hash":"QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn","size":4}]
@ColdSauce
ColdSauce / Bubble.scala
Last active March 13, 2017 01:27
code golf
object Bubble {
val r = scala.util.Random
def getNewBoardIteration(board: Vector[Vector[Boolean]]): Vector[Vector[Boolean]] = {
val allFalse = board.zipWithIndex.map(row =>
row._1.zipWithIndex.filter(col =>
if(((row._2 % 2) + col._2) % 2 == 0)
!col._1
else
false
)

Keybase proof

I hereby claim:

  • I am coldsauce on github.
  • I am stefanaleksic (https://keybase.io/stefanaleksic) on keybase.
  • I have a public key whose fingerprint is CCCF 78B6 10FD 3562 DBA5 4428 374F A74F 4053 07CD

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am coldsauce on github.
  • I am stefanaleksic (https://keybase.io/stefanaleksic) on keybase.
  • I have a public key whose fingerprint is 9175 4FB1 9F3E 5342 B59E 5BF1 0B4C 7393 8C1C 3825

To claim this, I am signing this object:

def draw_path(self,x,y):
top_right = 999999999999999999999999999999999999
top_left = 999999999999999999999999999999999999
top = 999999999999999999999999999999999999
if y == 0:
return
self.writablePixels[y,x] = (255,0,0)
# print str((x,y))
@ColdSauce
ColdSauce / gist:f123fdeb52d23ea79160
Created February 1, 2015 22:29
Read file line by line in Java
String line = "";
Bufferedreader br = new BufferedReader(new FileReader(new File("your file location")));
while((line = br.readLine()) != null){
// do stuff with line
}
@ColdSauce
ColdSauce / gist:0c8da327d6409f47992b
Created December 30, 2014 20:05
This Python script takes all adresses and phone numbers of local businesses and saves them in text files.
import urllib2
from bs4 import BeautifulSoup
html = urllib2.urlopen("http://www.yelp.com/search?find_loc=Schaumburg%2C+IL+60193").read()
soup = BeautifulSoup(html)
def writeToTextSelect(name):
for line in soup.select(name):
SocketIOClient.connect(AsyncHttpClient.getDefaultInstance(), "http://192.168.1.2:3000", new ConnectCallback() {
@Override
public void onConnectCompleted(Exception ex, SocketIOClient client) {
if (ex != null) {
ex.printStackTrace();
return;
}
client.setStringCallback(new StringCallback() {
@Override
public void onString(String string) {