Skip to content

Instantly share code, notes, and snippets.

@Holger-Will
Holger-Will / jwtRS256.sh
Last active May 6, 2024 00:35
generate public private key pair (RSA RS256) for use with koa-jwt jasonwebtoken etc.
# generate private key
openssl genrsa -out private.pem 2048
# extatract public key from it
openssl rsa -in private.pem -pubout > public.pem
@981746
981746 / example.html
Created March 16, 2016 06:12 — forked from schmuli/example.html
A simple AngularJS service for handling the 'onbeforeunload' event
<!DOCTYPE html>
<html data-ng-app="TestApp">
<head>
<script src="http://code.angularjs.org/1.2.9/angular.js"></script>
<script>
angular.module('TestApp', [])
.factory('beforeUnload', function ($rootScope, $window) {
// Events are broadcast outside the Scope Lifecycle
@roalcantara
roalcantara / sub_query.groovy
Last active March 1, 2024 16:49
Grails: Criteria + Subquery (DetachedCriteria)
/*
Suppose we need a query searching for all Equipments that are not being used in any ServiceOrder.
It means, given the following query:
select this_.*
from equipment this_
where this_.status == 'enabled'
and not exists (select so_.id as y0_ from service_order so_ where (so_.equipment_id=this_.id))
order by this_.serial_number asc;
@P7h
P7h / jdk_download.sh
Last active February 20, 2024 11:29
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@laacz
laacz / ios-addressbook.sql
Created August 30, 2011 12:16
SQL query to extract essential info from addressbook in iOS backup
--
-- This is SQL query to extract AddressBook info from respective sqlite3 file from iOS backup.
-- It has been tested only on my own backup, so, if anything is wrong, fork, edit, and stuff.
--
-- # parse-manifest.py from http://stackoverflow.com/questions/3085153/how-to-parse-the-manifest-mbdb-file-in-an-ios-4-0-itunes-backup
--
-- $ python ../parse-manifest.py | grep AddressBook.sqlitedb
-- -rw-r--r-- 000001f5 000001f5 1654784 1312812502 1312812502 1287387943 (31bb7ba8914766d4ba40d6dfb6113c8b614be442)HomeDomain::Library/AddressBook/AddressBook.sqlitedb
--
-- $ sqlite3 31bb7ba8914766d4ba40d6dfb6113c8b614be442