Skip to content

Instantly share code, notes, and snippets.

@ethack
ethack / TypeClipboard.md
Last active May 6, 2024 03:41
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 6, 2024 03:41
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@Dinir
Dinir / chatbox.css
Last active May 6, 2024 03:40
Streamlabs Chat Box - Scrolling Sideway
body {
background: $background_color;
color: $text_color;
font-size: $font_size;
}
.colon, .name {
height: 0px;
}
@xl1
xl1 / gist:fe779a817a9d4938193d
Last active May 6, 2024 03:35
Facebook API: 有効期限の長い Access Token を取得する

Facebook API: 有効期限の長い Access Token を取得する

tl;dr

  1. User Access Token を取得する
  2. それを使って長い期限のトークンを取得する
  3. /me/accounts?access_token={long_lived_token}
  4. 無期限のトークンが手に入る

API のバージョン

@staltz
staltz / router.js
Last active May 6, 2024 03:33 — forked from axefrog/router.js
Simple router driver for Cycle.js utilising Router5 for routing functionality and adapting some of the code from VisionMedia's Page.js for automatic link click intercepting
'use strict';
import {Router5, RouteNode} from 'router5';
import logger from '../logger';
// The set of valid sink functions includes synchronous state-affecting router functions that do not require a callback
// and which do not have a significant return value other than the router object itself.
const validSinkFuncs = ['add','addNode','canActivate','deregisterComponent','navigate','registerComponent','setOption','start','stop'];
function validateAndRemapSinkArgument(arg) {
@staltz
staltz / app.js
Created June 28, 2015 11:55
Draft of Cycle.js HTTP Driver
const Cycle = require('@cycle/core');
const CycleWeb = require('@cycle/web');
const makeHTTPDriver = require('@cycle/http');
const h = CycleWeb.h;
function main(responses) {
const GITHUB_SEARCH_API = 'https://api.github.com/search/repositories?q=';
// This essentially models when search requests are supposed
// to happen
@jhusain
jhusain / gist:db542bf5e2a0b79098ab
Created August 4, 2015 19:52
Redux style app
// mock falcor Model
function Model(root, path) {
this.root = root;
this.path = path || [];
}
Model.prototype.bind = function(path) {
return new Model(this.root, this.path.concat(path));
};
@jhusain
jhusain / gist:3c510869ec091772c440
Last active May 6, 2024 03:32
Observable map function
class Observable {
map(fn) {
if (typeof fn !== "function")
throw new TypeError(fn + " is not a function");
let C = this.constructor[Symbol.species];
return new C(observer => {
@jhusain
jhusain / gist:4b14f5069f3a254cfa0a
Created April 19, 2015 16:27
Converting event to Observable
function fromEvent(dom, eventName) {
return {
forEach: function(observer) {
var handler = (e) => {
observer.onNext(e);
};
dom.addEventListener(eventName, handler);
// Subscription
return {
@ChuckMichael
ChuckMichael / vcredistr.md
Last active May 6, 2024 03:32
Visual C++ Redistributable Packages