Skip to content

Instantly share code, notes, and snippets.

@chrislearn
chrislearn / webcryptoapi.html
Created November 13, 2018 04:43 — forked from deiu/webcryptoapi.html
Web Crypto API: RSA keygen & export & import & sign & verify & encrypt & decrypt
<html>
<head>
<script>
function generateKey(alg, scope) {
return new Promise(function(resolve) {
var genkey = crypto.subtle.generateKey(alg, true, scope)
genkey.then(function (pair) {
resolve(pair)
})
})
@chrislearn
chrislearn / gulp-php.js
Created April 1, 2016 03:49 — forked from jasonrhodes/gulp-php.js
Simple stream example for modifying file contents in gulp plugins
var through = require("through2");
var exec = require("child_process").exec;
// through2 docs: https://github.com/rvagg/through2
module.exports = function (options) {
// Not necessary to accept options but nice in case you add them later
options = options || {};
@chrislearn
chrislearn / README.md
Created February 26, 2016 07:51 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

@chrislearn
chrislearn / is_installed.sh
Created September 23, 2015 12:01 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script. Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@chrislearn
chrislearn / node-setup.bat
Created September 23, 2015 06:00 — forked from manuelbieh/node-setup.bat
Install node.js + some packages on Windows via Batchfile
@echo off
NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
echo This setup needs admin permissions. Please run this file as admin.
pause
exit
)
set NODE_VER=null
@chrislearn
chrislearn / path.js
Last active September 8, 2015 23:59 — forked from creationix/path.js
Simple path join and dirname functions for generic javascript
// Joins path segments. Preserves initial "/" and resolves ".." and "."
// Does not support using ".." to go above/outside the root.
// This means that join("foo", "../../bar") will not resolve to "../bar"
function join(/* path segments */) {
// Split the inputs into a list of path commands.
var parts = [];
for (var i = 0, l = arguments.length; i < l; i++) {
parts = parts.concat(arguments[i].split("/"));
}
// Interpret the path commands to get the new resolved path.
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
StartupNotify=true
Name=Smartgit
Exec=env SMARTGIT_JAVA_HOME=/opt/apps/jre7/ /opt/apps/smartgit/bin/smartgit.sh
Icon=/opt/apps/smartgit/bin/smartgit-64.png
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
StartupNotify=true
Name=Smartgit
Exec=env SMARTGIT_JAVA_HOME=/opt/apps/jre7/ /opt/apps/smartgit/bin/smartgit.sh
Icon=/opt/apps/smartgit/bin/smartgit-64.png

####lsauer.com


###Overview of all chrome:// pages.

  • List by calling chrome://about/
  • Following is a direct dump from the 'about' page for reference

###List of Pages as per v20.xxx