Skip to content

Instantly share code, notes, and snippets.

View jxub's full-sized avatar
🏯

Jakub Janarek jxub

🏯
View GitHub Profile
@JonathanAaron
JonathanAaron / gist:a1e101855ee82039d8ba
Last active September 6, 2016 13:12
Install Java JDK and BlueJ in Ubuntu
@jisaacstone
jisaacstone / elixir_distributed.ex
Last active July 10, 2018 18:26
programmatic node startup in elixir
defmodule ExDistUtils do
def start_distributed(appname) do
unless Node.alive?() do
local_node_name = generate_name(appname)
{:ok, _} = Node.start(local_node_name)
end
cookie = Application.get_env(appname, :cookie)
Node.set_cookie(cookie)
end
@cburgdorf
cburgdorf / xor_keras.py
Last active November 18, 2020 11:23
Comparing XOR between tensorflow and keras
import numpy as np
from keras.models import Sequential
from keras.layers.core import Activation, Dense
training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32")
target_data = np.array([[0],[1],[1],[0]], "float32")
model = Sequential()
model.add(Dense(32, input_dim=2, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

reading a file with ISO-8859-1 encoding in node.js

npm install iconv-lite
var fs = require('fs');
var iconv = require('iconv-lite');
iconv.decode(fs.readFileSync('file.txt'), 'iso-8859-1');
@andrewwatts
andrewwatts / request_time.py
Created March 10, 2012 19:33
urllib2 vs urllib3 vs requests
#!/usr/bin/env python2.7
import time
_URL = 'http://localhost/tmp/derp.html'
_NUMBER = 1000
def test_urllib2():
import urllib2
@13yo
13yo / pom.xml
Created January 23, 2012 12:38 — forked from tomoconnor/pom.xml
Example pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>jpademo</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<scm>
@nbaksalyar
nbaksalyar / decentralized-resources.md
Last active March 1, 2023 06:11
Resources and links for the WebRTC talk at Full Stack Fest 2017
@bradmontgomery
bradmontgomery / ShortIntroToScraping.rst
Created February 21, 2012 02:00
Really short intro to scraping with Beautiful Soup and Requests
@aparrish
aparrish / tracery-with-data.ipynb
Last active July 18, 2023 20:00
Tracery and Python. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mprajwala
mprajwala / import_csv_to_mongo
Last active July 23, 2023 20:07
Store CSV data into mongodb using python pandas
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)