Skip to content

Instantly share code, notes, and snippets.

Dinis Cruz DinisCruz

Block or report user

Report or block DinisCruz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Github-network-graph.js
function hide(selector) { $(selector).setAttribute('style','display:none')}
function remove(selector) { $(selector).remove()}
function remove_class(selector) { $(selector).setAttribute('class','')}
function move_left(count)
{
var eventObj = document.createEvent("Events");
eventObj.initEvent("keydown", true, true);
eventObj.which = 37; // left key
for (i=0; i < count ; i++) {
@DinisCruz
DinisCruz / Github-network-graph.js
Created Sep 10, 2019
Show a better network graph
View Github-network-graph.js
function hide(selector) { $(selector).setAttribute('style','display:none')}
function remove(selector) { $(selector).remove()}
function remove_class(selector) { $(selector).setAttribute('class','')}
function move_left(count)
{
var eventObj = document.createEvent("Events");
eventObj.initEvent("keydown", true, true);
eventObj.which = 37; // left key
for (i=0; i < count ; i++) {
@DinisCruz
DinisCruz / bokeh.py
Last active May 15, 2019
Jupyter OSBot-Commands
View bokeh.py
#https://bokeh.pydata.org/
#http://bokeh.pydata.org/en/latest/docs/installation.html
#https://nbviewer.jupyter.org/github/bokeh/bokeh-notebooks/blob/master/quickstart/quickstart.ipynb
!pip install bokeh
from bokeh.plotting import figure
from bokeh.io import output_notebook, show
output_notebook()
from numpy import cos, linspace
x = linspace(-6, 60, 1200)
@DinisCruz
DinisCruz / print-okrs.js
Created Aug 24, 2018
Jira JQuery filters
View print-okrs.js
$('.jira-issues th').css({ 'min-width' : '100px' } )
$('#title-text').height(100)
$('.jira-issues th:nth-child(1)').css({'min-width': '700px'})
@DinisCruz
DinisCruz / gulpfile.coffee
Created Mar 28, 2017
Simple gulp file to serve and watch Jekyll pages
View gulpfile.coffee
browserSync = require('browser-sync').create();
gulp = require('gulp');
shell = require('gulp-shell');
gulp.task 'build', shell.task(['jekyll build --incremental'])
gulp.task 'reload-page', ['build'], -> browserSync.reload()
gulp.task 'default' , ['build'],->
View gist:1a5fbd548c15a7a6419366c8553f4837
download docker
install docker (click cancel on the VirtualBox question)
on cmd.exe/sh
docker-machine create --driver=virtualbox default
docker-machine ssh default
docker run hello-world
docker run -it ubuntu bash
docker run -it -p 3000:3000 gogs/gogs
@DinisCruz
DinisCruz / set-cert-pwd.sh
Created Dec 14, 2016
Script to set the pwd to use curl with an bbc cert (exported in OSX from KeyChain access)
View set-cert-pwd.sh
#!/bin/bash
echo
echo "Note: run this using . ./set-cert-pwd.sh to set the variable in the host bash (it is expected that the bbc-cert.p12 is in the current path"
echo "What is the .p12 password: "
read -s pwd
export P12_PWD=$pwd
echo "The password has been set to the P12_PWD variable"
echo
@DinisCruz
DinisCruz / setup-maven.sh
Created Dec 5, 2016
Jenkins install automation scripts (to work as jenkins jobs)
View setup-maven.sh
cd ~/_tools
wget http://mirror.catn.com/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzvf apache-maven-3.3.9-bin.tar.gz
echo "export PATH=~/_tools/apache-maven-3.3.9/bin:$PATH" >> ~/.bashrc
@DinisCruz
DinisCruz / checking-if-app-exists.v1.sh
Last active Oct 12, 2016
Misc veracode code snippets
View checking-if-app-exists.v1.sh
function does_application_exist {
local app_name=$1
local result=$(veracode_get_app_Id "$app_name")
if [[ "$result" != "" ]]; then
echo "it exists"
else
echo "it doesn't exist"
fi
}
@DinisCruz
DinisCruz / bash-command.sh
Last active Oct 12, 2016
simple example to automatically run
View bash-command.sh
# run this on folder to monitor and location of on-change.sh file
fswatch -o . | xargs -n1 -I{} ./on-change.sh
You can’t perform that action at this time.