Skip to content

Instantly share code, notes, and snippets.

View rodrigopandini's full-sized avatar

Rodrigo Pandini rodrigopandini

View GitHub Profile
var url = require('url');
var https = require('https');
var querystring = require('querystring');
var webhookID = 'YOUR/WEBHOOK/integration-id';
var webhookURLBase = 'https://hooks.slack.com/services/';
var webhookURL = [webhookURLBase, webhookID].join('');
var slashCommandToken = 'your-slash-command-token';
@rodrigopandini
rodrigopandini / links desktop packager like
Created July 28, 2014 17:23
links to "desktop packager" projects
@rodrigopandini
rodrigopandini / createRulesImages.php
Last active December 10, 2015 13:48
Create horizontal(1000x16) and vertical(16x1000) images of rules (measured in pixels) to be used in, for example, online editors, using PHP and ImageMagick. (inspiration: http://www.ibm.com/developerworks/br/linux/library/l-pixelruler/index.html)
<?php
$rule1 = "img/rule1.jpg";
$ruleV = "img/ruleV.jpg";
$ruleH = "img/ruleH.jpg";
$width = 1000;
$height = 1000;
// horizontal rule
$str = "line 0,0 $width,0 line 0,15 $width,15";
$text = "";
<?php
$urlUploadImages = '../uploads/img/';
$nameImage = $_POST['nameImage'];
$data = base64_decode($_POST['strBase64']);
$img = imagecreatefromstring($data);
$width = imagesx($img);
$height = imagesy($img);
$image = imagecreatetruecolor($width, $height);
imagealphablending($image, true);
$alpha_image = imagecolorallocatealpha($image, 0, 0, 0, 127);