Skip to content

Instantly share code, notes, and snippets.

View degrammer's full-sized avatar
Coding Runme DevOps Notebooks for VS Code

Ruben Restrepo degrammer

Coding Runme DevOps Notebooks for VS Code
View GitHub Profile
@degrammer
degrammer / local-server
Created April 18, 2015 03:43
Create a local express web server, serve static files inside a folder named public, open a browser in the application port
var express = require('express');
var path = require('path');
var express = require('express');
var openPage = require('open');
var packageConfig = require('./package.json');
var server = null;
(function(){
console.log("**** Starting express server ******");
@degrammer
degrammer / Index.html
Created November 19, 2015 04:21
Communication between components This bin will demostrate how to communicate a controller with a directive function after doing some action from the external DOM of the directive // source https://jsbin.com/cikomoq
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="This bin will demostrate how to communicate a controller with a directive function after doing some action from the external DOM of the directive">
<link rel="stylesheet" href="https://material.angularjs.org/latest/angular-material.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
<title>Communication between components</title>
<style id="jsbin-css">
body {
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: {
app:'./app/src/app.js',
vendor: ['angular','angular-animate','angular-aria','angular-material']
},
output: {
filename: 'app/build/bundle.js'

Keybase proof

I hereby claim:

  • I am degrammer on github.
  • I am degrammer (https://keybase.io/degrammer) on keybase.
  • I have a public key whose fingerprint is B1EB ABFB 5CA4 4832 C34A A63C BB7B 8267 9AB6 BD7A

To claim this, I am signing this object:

module.exports = (url) => {
console.log(url.replace(/ /g, '').replace(/\n│/g,''));
};
@degrammer
degrammer / slash-command.js
Created January 19, 2022 16:40
GitHub Linear slash command
integration.event.on('/:componentName/webhook/issue_comment.created', async (ctx) => {
const {
data: { comment, repository, issue, installation },
} = ctx.req.body.data;
const commentText = comment.body;
const isLinearCommand = commentText.match(/^\/linear/g).length > 0;
if (isLinearCommand) {
const linearClient = await integration.service.getSdk(ctx, 'popular-js-linear', ctx.req.body.installIds[0]);
const [titlePart, description] = commentText.split('\n');
const title = titlePart.replace('/linear', '');
@degrammer
degrammer / discord-gspreadsheet-integration.js
Last active June 26, 2023 19:53
Google Spreadsheet + Discord Bot
const { Integration } = require('@fusebit-int/framework');
const integration = new Integration();
// Koa Router: https://koajs.com/
const router = integration.router;
const googleConnectorName = '{{GOOGLE CONNECTOR NAME HERE}}';
const discordConnectorName = '{{DISCORD CONNECTOR NAME HERE}}';
const spreadsheetId = '{{ID OF THE SPREADSHEET}}'
const discordChannelId = '{{DISCORD CHANNEL ID TO CREATE THE THREADS}}'
@degrammer
degrammer / .gitconfig
Created July 11, 2023 17:26
Git productivity configuration
# This is Git's per-user configuration file.
# Use this git configuration file to use some handy commands in your day-to-day work
[user]
name = <YOUR NAME HERE>
email = <YOUR EMAIL HERE>
[alias]
wip = !read -p \"Enter issue number: \" issue && read -p \"What feature are you working on?:\" name && git checkout -b \"wip/bencho/$issue-$name\"
ready = !git branch -m \"$(git branch --show-current | sed \"s/wip\\///g\")\"
copy = !git branch --show-current | pbcopy
alias = !git config --get-regexp alias
@degrammer
degrammer / index.js
Last active January 19, 2024 21:59
quick server
#!/usr/bin/env node
const http = require('http');
const url = require('url');
const server = http.createServer((req, res) => {
const parsedUrl = url.parse(req.url, true);
const queryStringParams = parsedUrl.query;
res.writeHead(200, {'Content-Type': 'text/plain'});
@degrammer
degrammer / index.js
Created January 23, 2024 22:39
endojs test
#!/usr/bin/env node
import "@endo/init";
const isFrozen = o => Object.isFrozen(o);
const mathCompartment = new Compartment({ Math, print: console.log });
mathCompartment.evaluate(`
const result = Math.pow(2, 5);