Skip to content

Instantly share code, notes, and snippets.

View ethagnawl's full-sized avatar
🐢

Pete Doherty ethagnawl

🐢
View GitHub Profile
@ethagnawl
ethagnawl / buy-now-snes-classic.rb
Last active October 12, 2017 03:55 — forked from anonymous/buy-now-snes-classic.rb
buy-now-snes-classic
require 'net/http'
require 'twilio-ruby'
require 'uri'
account_sid = 'SID'
auth_token = 'TOKEN'
@client = Twilio::REST::Client.new account_sid, auth_token
def notify!
@ethagnawl
ethagnawl / Main.elm
Created August 10, 2017 16:24 — forked from anonymous/Main.elm
decaying values
-- CO: https://ellie-app.com/3YJ65RSsjGRa1/1
module Main exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Html exposing (..)
import Json.Decode as Decode
import Time exposing (Time)
@ethagnawl
ethagnawl / elm_sprockets.rb
Created July 29, 2017 03:38 — forked from tmichel/elm_sprockets.rb
Elm Rails 4.2 integration (Sprockets 3.x)
# Elm integration for Sprockets 3.x (Rails 4.2)
#
# Revised version of a Sprockets 3.x processor for Elm. It supports
# dependencies. One little quirk is that only .js.elm files are
# requireable in application.js.
#
# How to use it?
#
# Put this file in your config/initializers/ and create
# app/assets/javascripts/MyModule.js.elm and require it in your
(ns comp3.core
(:use compojure.core)
(:require [compojure.route :as route]
[ring.adapter.jetty :as jetty]))
(defn simple-logging-middleware [app]
(fn [req]
(println req)
(app req)))
@ethagnawl
ethagnawl / README.md
Created March 11, 2017 21:50 — forked from seebk/README.md
Extract embedded certificates and keys from OpenVPN config files

This python script is intended to automate the extraction of embedded certificates and keys from OpenVPN config files.

Unfortunately the GNOME Network-Manager is not able to automatically import OpenVPN config files with embedded certificates and keys. A workaround is to manually extract these and store them in separate files (e.g. see https://naveensnayak.wordpress.com/2013/03/04/ubuntu-openvpn-with-ovpn-file/).

Instructions:

  • Make shure all the required packages are installed. For example on Ubuntu and Debian run:

    $ sudo apt-get install python3 network-manager-openvpn-gnome

@ethagnawl
ethagnawl / pQuery.js
Created February 15, 2017 21:15 — forked from niyazpk/pQuery.js
Add or update query string parameter
// Add / Update a key-value pair in the URL query parameters
function updateUrlParameter(uri, key, value) {
// remove the hash part before operating on the uri
var i = uri.indexOf('#');
var hash = i === -1 ? '' : uri.substr(i);
uri = i === -1 ? uri : uri.substr(0, i);
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
@ethagnawl
ethagnawl / Dockerfile
Created May 13, 2016 02:35 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@ethagnawl
ethagnawl / go.scm
Created May 5, 2016 03:48 — forked from AlexCharlton/go.scm
Go prototype in CHICKEN Scheme
(import chicken scheme)
(use hypergiant srfi-42 miscmacros)
;;;
;;; Game logic
;;;
;; Turns
(define turn (make-parameter 'black))
@ethagnawl
ethagnawl / heroku_deploy.rake
Created April 12, 2016 17:21 — forked from michaeldwan/heroku_deploy.rake
Simple Rake task for customizing deployment to Heroku
# List of environments and their heroku git remotes
ENVIRONMENTS = {
:staging => 'myapp-staging',
:production => 'myapp-production'
}
namespace :deploy do
ENVIRONMENTS.keys.each do |env|
desc "Deploy to #{env}"
task env do
@ethagnawl
ethagnawl / database.rake
Created March 31, 2016 17:59 — forked from jmccartie/database.rake
Copy Heroku production DB to local database
namespace :db do
desc "Copy production database to local"
task :copy_production => :environment do
###
# HEROKU
###
# Download latest dump