Skip to content

Instantly share code, notes, and snippets.

View EmilVarona's full-sized avatar

Emil Varona EmilVarona

  • evarona
View GitHub Profile
@andreyvolokitin
andreyvolokitin / bookmarksSearch.js
Created December 9, 2018 17:03
Search exported bookmarks HTML via browser console
const query = 'git';
const regexp = new RegExp(`\\b${query}\\b`, 'i');
Array.prototype.slice.apply(document.querySelectorAll('dt > a')).forEach(link => {
if (!regexp.test(link.innerHTML)) {
link.parentNode.removeChild(link);
}
});
@tilayealemu
tilayealemu / list-github-org-repos.py
Last active February 19, 2024 14:48
List organization's repos, last commit date to master and committer
# Script to fetch all repos under a git organization
# Returns last committer to master and date of commit
# Results sorted by commit date
# Replace ORG_NAME, USERNAME, and PASSWORD variables
import urllib2
import requests
import json
ORG_NAME = 'my-org'
@subfuzion
subfuzion / curl.md
Last active April 17, 2024 04:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@VictorCabello
VictorCabello / list_view.groovy
Created September 16, 2015 14:55
Jenkins script to list all views and their content
Jenkins.instance.views.each {
view ->
println "${view.name}"
view.items.each {
item ->
println "\t- ${item.name}"
}
}
return
# Install AWS cli, reference ~/.aws/config for the result
pip install --upgrade awscli
aws configure
# Create Cluster
aws emr create-cluster --ami-version VERSION --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.medium InstanceGroupType=CORE,InstanceCount=1,InstanceType=m1.medium --no-auto-terminate --name spark_cluster --bootstrap-action Path=s3://elasticmapreduce/samples/spark/1.0.0/install-spark-shark.rb,Name=install_spark --ec2-attributes KeyName=AWS_IAM
# SSH to master node
aws emr ssh --cluster-id JOB_ID --key-pair-file AWS_IAM.pem
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@danriti
danriti / hipchat-v2.sh
Last active July 19, 2021 10:49
HipChat API v2 - Send a message to a room using cURL
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=XXX
AUTH_TOKEN=XXX
MESSAGE="Hello world!"
curl -H "Content-Type: application/json" \
@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@pksunkara
pksunkara / config
Last active April 17, 2024 05:47
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta