Skip to content

Instantly share code, notes, and snippets.

@rdp
rdp / 0001-apple-keychain-integration-other-changes.patch
Created December 9, 2020 18:01 — forked from leonklingele/0001-apple-keychain-integration-other-changes.patch
openssh-{7.7,7.8,7.9,8.0,8.1,8.2,8.3,8.4}p1 patches for storing SSH passphrases in the OS X keychain. https://github.com/leonklingele/homebrew-dupes
From 1f00753130f44c0e29c34d95957f6eac2b2dcf45 Mon Sep 17 00:00:00 2001
From: Leon Klingele <git@leonklingele.de>
Date: Tue, 29 Sep 2020 18:21:13 +0200
Subject: [PATCH 1/2] apple-keychain-integration-other-changes
---
Makefile.in | 16 +-
audit-bsm.c | 7 +-
auth.c | 2 +-
authfd.c | 25 ++
@rdp
rdp / server.cr
Last active December 4, 2019 05:38 — forked from jgaskins/server.cr
Serve a sample JSON payload in Crystal
require "http"
require "uuid"
require "uuid/json"
class App
include HTTP::Handler
def call(context)
Fiber.yield # Simulate getting data from the DB
response_payload.to_json context.response
diff --git a/src/exception.cr b/src/exception.cr
index cd4450c..570e2fd 100644
--- a/src/exception.cr
+++ b/src/exception.cr
@@ -21,7 +21,11 @@ struct CallStack
makecontext_start = makecontext_end = LibDL.dlsym(LibDL::RTLD_DEFAULT, "makecontext")
while true
- ret = LibDL.dladdr(makecontext_end, out info)
+ ifdef cygwin
@rdp
rdp / mess.cr
Created September 28, 2016 21:25 — forked from crisward/mess.cr
kemal mysql
require "./mess/*"
require "kemal"
require "json"
require "mysql"
require "pool/connection"
db = ConnectionPool.new(capacity: 25, timeout: 0.01) do
DB.open(ENV["DATABASE_URL"])
end
@rdp
rdp / seek.js
Created September 25, 2016 04:23 — forked from dannyid/seek.js
Netflix Seek
// The player
var player = netflix.cadmium.objects.videoPlayer();
// Metadata about current episode -- ID and url to get frame at a specific time
var episodeId = netflix.cadmium.metadata.getActiveVideo().episodeId;
var imgRoot = netflix.cadmium.metadata.getActiveVideo().progressImageRoot;
// Generates URL of preview image for given timestamp
function getFrame(timestamp) {
var t = Math.floor(timestamp/10000).toString(10);
if ARGV.length != 2
puts "syntax: dir_that_has_files_that_should_be_duplicated dir_that_should_have_those_files"
exit 1
end
def all_files_in_dir dir
all_in = {}
Dir[File.expand_path(dir) + "/**/*"].each{|f| # need expand path or in windows Dir["a\b/*"] failz <sigh>
if File.file? f
filename = File.basename(f)
@rdp
rdp / evp.diff
Created March 9, 2015 21:37 — forked from anonymous/evp.diff
diff --git a/source_code/DibHelper.cpp b/source_code/DibHelper.cpp
index 4bfbd94..c8a02fe 100644
--- a/source_code/DibHelper.cpp
+++ b/source_code/DibHelper.cpp
@@ -165,7 +165,7 @@ boolean is_config_set_to_1(LPCTSTR szValueName) {
HKEY hKey;
LONG i;
i = RegOpenKeyEx(HKEY_CURRENT_USER,
- L"SOFTWARE\\screen-capture-recorder", 0, KEY_READ, &hKey);
+ L"SOFTWARE\\evp-capture", 0, KEY_READ, &hKey);
require 'java'
class A < javax.swing.JFrame
def initialize *args
super(*args)
end
end
A.new
package main
import "fmt"
import "strings"
// some ruby #map type things, in golang
// mostly taken from https://groups.google.com/forum/#!topic/golang-nuts/fgaeXCUEPC4
// apparently calling this out with specific types is faster than defining it generically to use interfaces: http://comments.gmane.org/gmane.comp.lang.go.general/43076
func _map(coll []string, f func(string) string) []string {
var newColl = make([]string, len(coll))
@rdp
rdp / invisible_command.rb
Last active December 6, 2019 07:22 — forked from jarib/file.rb
require "rubygems"
require "ffi"
module WinProcess
extend FFI::Library
ffi_lib "kernel32"
ffi_convention :stdcall
class Error < StandardError