Skip to content

Instantly share code, notes, and snippets.

View kyleparisi's full-sized avatar

Kyle Parisi kyleparisi

  • Newtown, PA
View GitHub Profile
@hfossli
hfossli / NodeTask.swift
Last active January 2, 2024 00:27
Start a node.js server using NSTask in Swift.
import Foundation
import Cocoa
class NodeTask: NSObject {
private let processIdentifier = NSProcessInfo.processInfo().processIdentifier
private let nodeTask = NSTask()
private let readPipe = NSPipe()
private let errorPipe = NSPipe()
private let queue = dispatch_queue_create("NodeTask.output.queue", DISPATCH_QUEUE_SERIAL)
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export HUBOT_SLACK_TOKEN=<REDACTED>
export HUBOT_LOG_LEVEL="info"
export HUBOT_AUTH_ADMIN=<REDACTED>
export REDIS_URL=redis://127.0.0.1:6379/hal
export HUBOT_DEFAULT_COMMANDS=""
cd $DIR/..
@neverything
neverything / <stage>.rb
Last active March 6, 2021 12:32
Dirty opcache_reset() for capistrano deployments to shared php envs without access to restart the server. With some recommended settings for the opcache configuration in php.ini
# In your config/deploy/<stage>.rb files add the correct path which is publicly curlable :D
# Opcache file url
set :opcache_file_url, "https://<add_public_url_of_stage>/opcache_clear.php"
@manifestinteractive
manifestinteractive / sniff.txt
Last active November 23, 2023 02:16
A friendly formatter for curl requests to help with debugging.
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@shashi
shashi / sneaky-dom.js
Last active March 29, 2016 18:29
Sneaky, Shady DOM
(function() {
function Sneaky (node) {
var lightNode = Polymer.dom(node)
this.lightNode = lightNode
this.node = lightNode.node
}
Sneaky.prototype = Polymer.dom()
Object.defineProperties(Sneaky.prototype, {
@mskutta
mskutta / EdgeRouter_IPv6_Commands_for_Comcast.txt
Last active December 6, 2023 02:11
EdgeRouter IPv6 Commands for Comcast
configure
# Configure Firewall
set firewall ipv6-name IPV6WAN_IN description 'IPV6WAN to internal'
set firewall ipv6-name IPV6WAN_IN default-action drop
set firewall ipv6-name IPV6WAN_IN rule 10 action accept
set firewall ipv6-name IPV6WAN_IN rule 10 state established enable
set firewall ipv6-name IPV6WAN_IN rule 10 state related enable
set firewall ipv6-name IPV6WAN_IN rule 10 log disable
@kamermans
kamermans / configure_docker0.sh
Last active April 26, 2024 00:58
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the
# Docker daemon using a JSON config file. On Linux, this file is normally located at
# /etc/docker/daemon.json. You should use this JSON config method if you are running
# a version of Docker that is at least 1.10!
# Here is an example configuration that sets the docker0 bridge IP to 192.168.254.1/24:
# {
# "bip": "192.168.254.1/24"
# }
@rhelmer
rhelmer / gist:b075f21f44f3e98579b1
Last active November 1, 2022 12:13
herokuish build+deploy using LXC

Introduction

Heroku differs from traditional build & deploy by having the concept of "buildpacks", which are a generic method to identify, compile and package builds. The traditional method here would be to have hardcoded build commands, in a Makefile for instance. Buildpacks generally make custom build+deploy steps uneccessary, although one can specify custom buildpacks if necessary.

When notifying Heroku that a deploy is needed (usually by a Github webook), Heroku will run through all supported buildpacks until one can identify your app, which is then compiled and packaged by the buildpack. The output of this process is referred to as a "slug", which contains your app and all dependencies. For instance, a Python app would have the virtualenv packaged inside it. Heroku automatically deploys slugs that are built successfully.

This document describes a way to use LXC and existing third-party tools to reproduce this setup.

You need to have a server running that accepts webhooks and can take act

@jaredmorrow
jaredmorrow / read_write_fifo_erlang.md
Last active April 22, 2023 20:05
Reading and Writing to Fifo (named pipes) in Erlang

edit

@akash-akya pointed out in the comments that the file module supports named pipes since OTP 20. So none of this post is really needed anymore if you are on >= OTP 21.


Erlang and Named Pipes

The intention of this post is to provide a solution (with examples) to a somewhat uncommon issue in Erlang. I hate searching for answers to the same problems over and over, and I had a hard time finding answers to this particular problem, so I wrote it all down once I figured it out. If one day you decide to read and write data through fifo's (named pipes) and then decide you want to read or write the other end of the pipe from Erlang, this post is for you.

@shawn-crigger
shawn-crigger / superhead.html
Last active November 21, 2020 19:38
My HTML head meta tags
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//ajax.googleapis.com">
<link rel="dns-prefetch" href="//farm7.staticflickr.com">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?