Skip to content

Instantly share code, notes, and snippets.

View thgs's full-sized avatar
👻

Theo Gotsopoulos thgs

👻
View GitHub Profile
@melriffe
melriffe / spike.rb
Created May 3, 2012 17:50
PragPubinator: Script to download PragPub Magazine into your Dropbox folder
#! /usr/bin/env ruby
# Solution Spike, a down-n-dirty implementation of the desired functionality.
require 'rubygems'
require 'mechanize' # mechanize 2.4
target_directory = "#{ENV['HOME']}/Dropbox/Pragmatic Bookshelf/Magazines" # ruby 1.9
FileUtils.mkdir_p target_directory
@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@mburst
mburst / rss_reader.php
Created March 24, 2013 03:58
RSS Feed Reader in PHP
<html>
<head>
<title>RSS Feed Reader</title>
</head>
<body>
<?php
//Feed URLs
$feeds = array(
"http://maxburstein.com/rss",
"http://www.engadget.com/rss.xml",
@dwgill
dwgill / mpvctl
Last active January 25, 2023 02:00
A small script for controlling mpv via the JSON IPC. Intended to resemble playerctl.
#!/usr/bin/env bash
# This script requires:
# - that the directory $HOME/.mpv exist
# - that the program socat be installed
# - that you start mpv with the unix socket feature pointing at that directory
# I recommend an alias in your .bashrc or equivalent file:
# alias mpv="mpv --input-unix-socket=$HOME/.mpv/socket"
socket="$HOME/.mpv/socket"
@ttesmer
ttesmer / AD.hs
Last active June 7, 2024 03:56
Automatic Differentiation in 38 lines of Haskell using Operator Overloading and Dual Numbers. Inspired by conal.net/papers/beautiful-differentiation
{-# LANGUAGE TypeSynonymInstances #-}
data Dual d = D Float d deriving Show
type Float' = Float
diff :: (Dual Float' -> Dual Float') -> Float -> Float'
diff f x = y'
where D y y' = f (D x 1)
class VectorSpace v where
zero :: v
@bobmagicii
bobmagicii / composer.json
Last active May 17, 2024 05:30
lulz with Aspectus\Terminal
{
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": {
"netherphp/*": "source",
"*": "dist"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,