Skip to content

Instantly share code, notes, and snippets.

View pwasiewi's full-sized avatar
😎
An usual day ;)

Piotr Wasiewicz pwasiewi

😎
An usual day ;)
View GitHub Profile
@cbare
cbare / linear_regression_by_gradient_descent.R
Created July 27, 2012 21:52
Linear regression by gradient descent
##
## Linear regression by gradient descent
##
## A learning exercise to help build intuition about gradient descent.
## J. Christopher Bare, 2012
##
# generate random data in which y is a noisy function of x
x <- runif(1000, -5, 5)
y <- x + rnorm(1000) + 3
@rladstaetter
rladstaetter / WaterSimulation.scala
Created January 10, 2013 21:53
A simple Scala program using JavaFX to show a simple water simulation in 2D
package net.ladstatt.apps.watersimulation
import scala.collection.JavaConversions.seqAsJavaList
import javafx.animation.Animation
import javafx.animation.KeyFrame
import javafx.animation.Timeline
import javafx.application.Application
import javafx.event.ActionEvent
import javafx.event.EventHandler
@dogukancagatay
dogukancagatay / Makefile
Last active September 21, 2022 16:03
List OpenCL devices on the system using OpenCL C++ Wrapper.
UNAME_S := $(shell uname -s)
# -std=c++11 -Wall -march=native
ifeq ($(UNAME_S),Linux)
CXX=clang++
CPPFLAGS=-O3
LDFLAGS=-O3
LDLIBS=-lOpenCL
endif
ifeq ($(UNAME_S),Darwin)

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@bstancil
bstancil / Finding User Sessions with SQL
Last active October 18, 2023 16:07
These queries let you define find user sessions against event data logged to Segment SQL, Snowplow, or Google BigQuery.
-- These queries let you define find user sessions against event data
-- logged to Segment SQL, Snowplow, or Google BigQuery.
-- For more details, see the full post:
-- LINK
--- SEGMENT SQL
-- Finding the start of every session
SELECT *
FROM (
@jasonrdsouza
jasonrdsouza / combineS3Files.py
Last active June 3, 2023 17:22
Python script to efficiently concatenate S3 files
'''
This script performs efficient concatenation of files stored in S3. Given a
folder, output location, and optional suffix, all files with the given suffix
will be concatenated into one file stored in the output location.
Concatenation is performed within S3 when possible, falling back to local
operations when necessary.
Run `python combineS3Files.py -h` for more info.
'''
@pwasiewi
pwasiewi / ubuntu.sh
Created May 4, 2016 21:47 — forked from jarutis/ubuntu.sh
Theano and Keras setup on ubuntu with OpenCL on AMD card
## install Catalyst proprietary
sudo ntfsfix /dev/sda2
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.BAK
sudo apt-get remove --purge fglrx*
sudo apt-get install linux-headers-generic
sudo apt-get install fglrx xvba-va-driver libva-glx1 libva-egl1 vainfo
sudo amdconfig --initial
## install build essentials
sudo apt-get install cmake
@longcao
longcao / SparkCopyPostgres.scala
Last active December 26, 2023 14:47
COPY Spark DataFrame rows to PostgreSQL (via JDBC)
import java.io.InputStream
import org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils
import org.apache.spark.sql.{ DataFrame, Row }
import org.postgresql.copy.CopyManager
import org.postgresql.core.BaseConnection
val jdbcUrl = s"jdbc:postgresql://..." // db credentials elided
val connectionProperties = {
@kevin39
kevin39 / Proxmox reload services
Last active March 5, 2024 20:13
Proxmox reload services properly (services order is important)
service pve-cluster restart && service pvedaemon restart && service pvestatd restart && service pveproxy restart
<pyopencl.Device 'Tonga' on 'AMD Accelerated Parallel Processing' at 0x749460>
Repeating [test_overwrite_ecb()] 1000 times....
Function [test_overwrite_ecb] finished in average of 0:00:00.003962
Repeating [test_overwrite_efb()] 1000 times....
Function [test_overwrite_efb] finished in average of 0:00:00.002380