Skip to content

Instantly share code, notes, and snippets.

@mreq
mreq / github-issue-title.user.js
Created June 20, 2023 10:28
Copies issue number and title on click
// ==UserScript==
// @name github issue title
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @grant GM_setClipboard
// ==/UserScript==
@mreq
mreq / github_issue_title.js
Created February 11, 2021 09:08
Copies number and issue title to clipboard on click
// ==UserScript==
// @name github issue title
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @grant GM_setClipboard
// ==/UserScript==
<!DOCTYPE html>
<html>
<head>
<title>osa</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style type="text/css">
table {
margin: 70px auto 100px;
}
@mreq
mreq / controllers.application.js
Created February 14, 2017 21:20
SO - Ember global variable
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
require 'open-uri'
class YamlFixtureLoader
def load!(paths)
paths.each do |path|
load_path!(path)
end
end
private
@mreq
mreq / rails_admin.cs.yml
Created January 24, 2013 08:00
Czech rails_admin translation
cs:
admin:
home:
name: "Úvodní stránka"
pagination:
previous: "&laquo; Předchozí"
next: "Další &raquo;"
truncate: "…"
misc:
filter_date_format: "dd. mm. yy" # a combination of 'dd', 'mm' and 'yy' with any delimiter. No other interpolation will be done!
@mreq
mreq / t-dynamic.coffee
Created September 15, 2015 22:46
ember-i18n dynamic helper
`import Ember from 'ember'`
TDynamicHelper = Ember.Helper.extend
i18n: Ember.inject.service()
compute: (params) ->
key = params.join('.')
@get('i18n').t key
`export default TDynamicHelper`
@mreq
mreq / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// I found this somewhere on the intertubes, and optimized it
$.fn.insertAtCaret = function(myValue) {
return this.each(function() {
var me = this;
if (document.selection) { // IE
me.focus();
sel = document.selection.createRange();
sel.text = myValue;
me.focus();
} else if (me.selectionStart || me.selectionStart == '0') { // Real browsers
@mreq
mreq / pexeso.R
Last active August 29, 2015 14:10
R pexeso
##################################
# Created by Petr Marek for 4ST417
# https://github.com/mreq
#
# requires tkrplot, RColorBrewer
##################################
pexeso <- function(pairs = 10) {
# Handle requirements
if (!require(tcltk) || !require(tkrplot) || !require(RColorBrewer))