Skip to content

Instantly share code, notes, and snippets.

View grxy's full-sized avatar
🇺🇸

Grex grxy

🇺🇸
View GitHub Profile
@grxy
grxy / 0-file-with-fragment.graphql
Created August 24, 2023 21:17
graphql-eslint require-import-fragment bug
fragment MyFragment on Query {
myField
}
set target to "+1 (123) 456-7890"
set message to "message"
set i to 100
repeat i times
tell application "Messages"
send message to buddy target of (service 1 whose service type is iMessage)
end tell
end repeat
@grxy
grxy / keybase.md
Created June 18, 2017 18:17
Keybase proof

Keybase proof

I hereby claim:

  • I am grxy on github.
  • I am grex (https://keybase.io/grex) on keybase.
  • I have a public key whose fingerprint is 2537 B47D 0BE2 1CCF F725 4C27 FC45 3AFE 7F73 2C21

To claim this, I am signing this object:

function (arr) {
for (let i = 0; i < Math.floor(arr.length / 2); i++) {
const temp = arr[i];
arr[i] = arr[arr.length - i - 1];
arr[arr.length - i - 1] = temp;
}
let start = 0;
let end = 0;
@grxy
grxy / fun.less
Created May 13, 2016 20:07
Fun with less
.for(@i, @n) {.-each(@i)}
.for(@n) when (isnumber(@n)) {.for(1, @n)}
.for(@i, @n) when not (@i = @n) {
.for((@i + (@n - @i) / abs(@n - @i)), @n);
}
// ............................................................
// .for-each
.for(@array) when (default()) {.for-impl_(length(@array))}
@grxy
grxy / get-query-param.js
Created January 11, 2016 20:32
A simple memoized function to get a query param from the current url. Could be more robust, but it's a start.
var getQueryParam = (function () {
var query = false;
return function (param) {
if (!query) {
query = {};
window.location.search.replace('?', '').split('&').forEach(function (item) {
item = item.split('=');
query[item[0]] = item[1];
@grxy
grxy / combine.js
Created June 13, 2015 18:54
A solution to a JS problem that came up at work
var combine = function (arr) {
var issues = [];
for (var item in arr) {
var week = arr[item].week;
issues[week] = issues[week] || {};
for (var issue in arr[item]) {
issues[week][issue] = arr[item][issue];
}
}
for (week in issues) {