Skip to content

Instantly share code, notes, and snippets.

@ruzz311
ruzz311 / gh-pr-cleanup.js
Created June 15, 2022 15:57
Remove yourself from any assigned/review-requested PRs in a given project.
#!/usr/bin/env node
const util = require('util');
const exec = util.promisify(require('child_process').exec);
/**
* Retrieve any assigned PRs for the user/project combo.
*
* @param {string} ghRepo Repository using the [HOST/]OWNER/REPO format
* @param {string} ghUser
@ruzz311
ruzz311 / gist:0ce510792b317e7b6be93f6d0e752a18
Created July 26, 2020 13:24 — forked from riston/gist:3016944
Random number generating (Box-Muller)
var Random = {
/**
* Numbers between ~( -2 to 2 )
* http://stackoverflow.com/questions/75677/converting-a-uniform-distribution-to-a-normal-distribution
* http://c-faq.com/lib/gaussian.html
*/
gaussian: function() {
var x1, x2, r;
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
actions: {
error(error, transition){
transition.send('setFlashMessage', 'ANOTHER ERRRR');
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
});
@ruzz311
ruzz311 / macros.gs
Created September 6, 2018 18:16
Google Sheets Macro Function - Highlight a max/min values in a column
/** @OnlyCurrentDoc */
function myFunction2() {
var spreadsheet = SpreadsheetApp.getActive();
var conditionalFormatRules = spreadsheet.getActiveSheet().getConditionalFormatRules();
conditionalFormatRules.push(SpreadsheetApp.newConditionalFormatRule()
.setRanges([spreadsheet.getActiveRange()])
.whenFormulaSatisfied('=$H:$H=max(H:H)')
.setBackground('#B7E1CD')
@ruzz311
ruzz311 / toggleGMT.scpt
Created September 5, 2018 09:45
An applescript to toggle timezone between current location and GMT. Exporting as a "readonly app" will prevent others from seeing your password
property myUser : "user-name"
property myPass : "password"
property defaultTimeZone : "America/Los_Angeles"
on doSudoShellScript(myScript)
return do shell script myScript user name myUser password myPass with administrator privileges
end doSudoShellScript
on getTimeZone()
return doSudoShellScript("/usr/sbin/systemsetup -gettimezone")
@ruzz311
ruzz311 / info.plist
Created September 5, 2018 07:24
Alfred workflow to toggle timezone between GMT and current location.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>com.madsendev.togglegmt</string>
<key>connections</key>
<dict>
<key>8E1C4B16-49E0-49CE-AA11-53CE3D9F3948</key>
<array>
@ruzz311
ruzz311 / INSTRUCTIONS.MD
Created September 4, 2018 14:49
how to dark theme slack
@ruzz311
ruzz311 / args-to-string.js
Created August 31, 2018 20:32
call this function to get a string of method params with their values.
/**
* Print the names and values for arguments of the supplied method. The example
* should create a log containing the line: ```[foo:"bar", spam:"eggs"]```
* ```JavaScript
* function myFunction(foo, spam){
* _argsToString(...arguments)
* }
* myFunction("bar", "eggs")
* ```
* @param {...*} - apply all arguments to your calling method