Skip to content

Instantly share code, notes, and snippets.

View j3lte's full-sized avatar

Jelte Lagendijk j3lte

View GitHub Profile

Keybase proof

I hereby claim:

  • I am j3lte on github.
  • I am j3lte (https://keybase.io/j3lte) on keybase.
  • I have a public key whose fingerprint is 4C4F C100 D442 BBC7 DA9F 78BE 8040 EB69 77A7 270C

To claim this, I am signing this object:

@j3lte
j3lte / nordvpn.sh
Created February 8, 2023 12:16 — forked from Dreyer/nordvpn.sh
Check the status of a NordVPN connection from your shell.
#!/bin/bash
URL='https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data'
JSON=$(curl -s $URL)
printf "\n"
#echo $JSON | python -m json.tool
echo $JSON | python -c 'import sys, json; data = json.load(sys.stdin); print "IP: %s (%s)\nStatus: %s" % (data["ip"], data["isp"], "\033[32mProtected" if data["status"] is True else "\033[31mUnprotected");'
printf "\n"
@j3lte
j3lte / postgres_queries_and_commands.sql
Created November 15, 2022 16:28 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@j3lte
j3lte / xml.json
Last active September 20, 2023 13:59
Mendix XML snippets
{
"MX Widget Property: attribute": {
"prefix": "propAttr",
"body": [
"<property key=\"$1\" type=\"attribute\" dataSource=\"$2\" required=\"${3|true,false|}\" onChange=\"$4\">",
" <caption>$5</caption>",
" <description>$6</description>",
" <attributeTypes>",
" <attributeType name=\"${7|AutoNumber,Binary,Boolean,DateTime,Decimal,Enum,HashString,Integer,Long,String|}\" />",
" </attributeTypes>",
@j3lte
j3lte / git.migrate
Created February 27, 2016 15:32 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@j3lte
j3lte / bongo.sh
Last active August 29, 2015 14:27 — forked from nhoening/bongo.sh
Allowing to pass a query for exporting specific data. Added a LIMIT option to limit the number of returned results. Added a debug switch to see errors.
#!/bin/bash
LOADING=false
DEBUG=/dev/null
usage()
{
cat << EOF
usage: $0 [options] <DBNAME>
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
@j3lte
j3lte / popup-snippet.js
Last active April 20, 2018 02:21
Contentscript that can be injected by Google Chrome extension in order to check a variable on a page
var performTests = function (callback) {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
var thisTab = tabs[0];
chrome.tabs.executeScript(thisTab.id, {file: 'scripts/variable-checker.js'}, function(data) {
var response = data[0].response;
callback(response);
});
});
};
@j3lte
j3lte / gulpfile.js
Last active August 29, 2015 14:22 — forked from lmartins/gulpfile.js
// Include gulp
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
prefix = require('gulp-autoprefixer'),
coffee = require('gulp-coffee'),
coffeelint = require('gulp-coffeelint'),
concat = require('gulp-concat'),
plumber = require('gulp-plumber'),
changed = require('gulp-changed'),
@j3lte
j3lte / gulpfile.js
Last active August 29, 2015 14:22 — forked from ktmud/gulpfile.js
var BatchStream = require('batch-stream2')
var gulp = require('gulp')
var coffee = require('gulp-coffee')
var uglify = require('gulp-uglify')
var cssmin = require('gulp-minify-css')
var bower = require('gulp-bower-files')
var stylus = require('gulp-stylus')
var livereload = require('gulp-livereload')
var include = require('gulp-include')
var concat = require('gulp-concat')