This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inject = (args..., fn) -> | |
script = document.createElement 'script' | |
script.innerHTML = """ | |
Array.prototype.pop.call(document.getElementsByTagName('script')).innerText = JSON.stringify(function() { | |
try { return #{ fn.toString() }.apply(window, #{ JSON.stringify args }); } | |
catch(e) { return {isException: true, exception: e.toString()}; } | |
}()); | |
""" | |
document.body.appendChild script | |
response = JSON.parse script.innerText |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color : #000 !important; | |
background-image : url("http://raw.github.com/oliversalzburg/se-chat-dark-theme/master/img/skewed_print.png") !important; | |
color : #ddd !important; | |
} | |
.messages { | |
background-color : #222 !important; | |
border : none !important; | |
color : #ddd !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
##### Automatically post to your Google+ account from the commandline. | |
##### (C) 2012 Boris Buegling <boris@icculus.org> | |
require 'rubygems' | |
require 'mechanize' | |
## Use Windows Mobile user agent to get Basic Mobile HTML | |
agent = Mechanize.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _common_section | |
printf $c1 | |
printf $argv[1] | |
printf $c0 | |
printf ":" | |
printf $c2 | |
printf $argv[2] | |
printf $argv[3] | |
printf $c0 | |
printf ", " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AutoReviewComments | |
// @namespace benjol | |
// @version 1.3.1 | |
// @description Add pro-forma comments dialog for reviewing (pre-flag) | |
// @grant none | |
// @include http*://*stackoverflow.com/questions* | |
// @include http*://*stackoverflow.com/review* | |
// @include http*://*stackoverflow.com/admin/dashboard* | |
// @include http*://*stackoverflow.com/tools* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// E2E Test Setup | |
// e2e_helpers.js | |
// | |
import { getMainDefinition } from '@apollo/client/utilities' | |
import { AuthPayload } from '../../lib/typings/goodchat' | |
import { WebSocketLink } from '@apollo/client/link/ws' | |
import { promisify } from 'util' | |
import fetch from 'cross-fetch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rabbitmqctl add_user test test | |
rabbitmqctl set_user_tags test administrator | |
rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test("mocking a request", async () => { | |
const mockAgent = new MockAgent() | |
;(global as any).setMockedFetchGlobalDispatcher(mockAgent) | |
await fetch(...) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this code in browser console to debug ui-router problems when navigating through states. | |
var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope'); | |
$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeStart from '+fromState.name+'- fired when the transition begins. fromState,fromParams : \n',fromState, fromParams); | |
console.log('$stateChangeStart to '+toState.name+'- fired when the transition begins. toState,toParams : \n',toState, toParams); | |
}); | |
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){ |
OlderNewer