Skip to content

Instantly share code, notes, and snippets.

View PHPirates's full-sized avatar

Thomas Schouten PHPirates

View GitHub Profile
plugins {
id "org.jetbrains.intellij" version "0.2.15"
id "maven"
id "de.undercouch.download" version "3.2.0"
}
task setupPycharm() {
if (!new File('.gradle/ide').exists()){
download {
src 'https://download.jetbrains.com/python/pycharm-professional-2017.2.tar.gz'
dest '.gradle/downloads/py.tar.gz'
@rverton
rverton / chrome_headless_screenshot.py
Created July 10, 2017 08:53
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@calebreister
calebreister / csv.lua
Created April 28, 2017 17:21
Lua script that converts a CSV file to the LaTeX tabular format
--To include this file, use
--dofile('csv.lua') or require('csv')
--Function to convert a *SV file to a Lua array
--file: the name of the file to read
--delim: the delimeter (default ',')
function dataToTable(file, delim)
--Set initial values
if delim == nil then --allow delim to be optional
delim = ','
@nh2
nh2 / LevMarExample.hs
Created July 14, 2016 11:54
Example on how to use the levmar Haskell package for the Levenberg–Marquardt optimisation algorithm
-- Example made with levmar-1.2.1.5
{-# LANGUAGE ViewPatterns #-}
import qualified Data.Vector.Storable as V
import Numeric.LevMar
-- | Function over X with 1 parameter (a); we want to find
-- the `a` that best fits a set of
fun a x = sin (a*x)
@TheRayTracer
TheRayTracer / mushrooms_explore_a.png
Last active October 6, 2022 20:30
Using R to explore the UCI mushroom dataset reveals excellent KNN prediction results.
mushrooms_explore_a.png
@parmentf
parmentf / GitCommitEmoji.md
Last active July 24, 2024 23:03
Git Commit message Emoji
@jewelsea
jewelsea / PopupButton.java
Last active October 31, 2016 16:05
Shows how to make a small context sensitive dialog which popups on pressing a button.
import java.util.Random;
import javafx.application.Application;
import javafx.event.*;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;