Skip to content

Instantly share code, notes, and snippets.

View Qard's full-sized avatar
👨‍💻
In an epic battle with my keyboard.

Stephen Belanger Qard

👨‍💻
In an epic battle with my keyboard.
View GitHub Profile
@Qard
Qard / userscript.js
Created December 21, 2023 07:13 — forked from fanuch/userscript.js
Block Click to Edit on Jira Issue
// ==UserScript==
// @name Disable Jira Click Edit
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disable click edit in Jira issue descriptions
// @author fanuch
// @match https://*.atlassian.net/browse/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net
// @grant none
// ==/UserScript==
function betterPromise (executor) {
let args
const promise = new Promise((..._args) => {
args = _args
})
executor.apply(null, args)
return promise
$ ./configure && make test
creating ./icu_config.gypi
* Using ICU in deps/icu-small
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'asan': 0,
class Handler
def initialize
with self yield
end
def hello
puts "this should work..."
end
end
var algorithm = crypto.getHashes()[0]
var hash = crypto.createHash(algorithm) // crypto entry
hash.update('foo')
fs.readFile(__filename, function (err, data) {
hash.update('bar')
var hashed = hash.digest() // crypto exit
done()
})
@Qard
Qard / problems.md
Last active August 29, 2015 14:16
Framework-level tracing notes

Problems

  • Input events are difficult/impossible to hook into at framework level
    • Angular uses html data-binding without user-defined interactions, or sometimes ng-click attributes (but still bound to a private scope). This logic is all lost somewhere deep in the internals, completely inaccessible to outside code.
    • Ember uses an action filter in mustache (http://emberjs.com/guides/templates/actions/). Again, inaccessible internals...
    • React uses on* attributes in JSX. It's possible to intercept them via React.createElement(...), but associating the virtual DOM representation with the corresponding real DOM element is not possible without patching the DOM itself.
  • Scope inheritance in angular makes it impossible to know what controller a given thing in the scope is coming from without modifying the core itself. (https://docs.angularjs.org/guide/controller#scope-inheritance-example)
  • MV* approach between the different frameworks varies rather drastically.
  • Angular has controllers, but the
@Qard
Qard / test.rb
Last active August 29, 2015 14:14
run `npm test` against every node version! (requires nvm and ruby)
require 'openssl'
require 'net/http'
uri = URI.parse("https://semver.io/node/versions")
# uri = URI.parse("https://semver.io/iojs/versions")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # read into this
result = http.get(uri.request_uri)
function times (n, fn) {
return function () {
if (n > 0) {
n--
return fn.apply(this, arguments)
}
}
}
var hello = times(2, function () {
@Qard
Qard / evil.js
Created October 8, 2014 23:41
I am a monster.
var Emitter = require('events').EventEmitter
var evil = new Emitter
evil.on('foo', function (get) {
console.log('privateThing is', get('privateThing'))
})
function foo () {
var privateThing = 'secret'
evil.emit('foo', function (prop) {
@Qard
Qard / scripts.json
Created February 17, 2014 03:51
This would be several hundred lines in grunt.
{
"start": "node --harmony server.js",
"dev": "exec-parallel 'npm run watch' 'npm run watch:test' 'nodemon --harmony server.js'",
"test": "mocha --harmony",
"coverage": "npm run coverage:report",
"coverage:build": "rm -rf coverage && node --harmony istanbul cover _mocha",
"coverage:report": "npm run coverage:build && istanbul report",
"coverage:html": "npm run coverage && node-open coverage/lcov-report/index.html",
"build": "exec-parallel 'npm run build:js' 'npm run build:css'",
"build:js": "browserify assets/js/main.js -o public/js/bundle.js",