Skip to content

Instantly share code, notes, and snippets.

View pid's full-sized avatar

Sascha pid

  • Baden-Württemberg, Germany
View GitHub Profile
@pid
pid / pid_id_rsa.pub
Created December 6, 2012 00:56
ssh public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCUyJ03rAFxudjk0Cytuf8LxBCdHwzfWFWbbPm1383kfgTFn3beyytahIj5BxOcVRbhUnnx5vuDpahsgkEGsA+H2q4JtQ3N8VXc6EoErgGfuwJ8iQNfa9x3CffNiUF2/4R4z6c6DmZSdUdt6HGSujst/xvOO45TqknRLdNaXP5JWmL30oIPTet+rlIsmBMr3rIcJztxIkCYL1X0B183AfO1UgwMc0SOmQFzsw4psYkll/pIs1isoguf+WZCK+6PzB75bJx4TIzgbQ6obhnSLB3mn3s01Q4cAHHt4+jJTcIQEaf/k0rKuJgeRDvmwL8CxQpL9u/gK/+LoYLkuRi+OxH+Z2zy+7HHJG3bDuKEKpbqc56DlfV3kxWE+AsUCquMudOzrRtMrk6IKL2rLTlC2ubhZrH9BDhpv+ep9b05aiEOriFVIbyhZ5/Q7NE+MQnQgQmeIb00ZNJ873gxUqxlzHo1UwgsX7KhxkuLRc7KCgStNV9UoNSYevo7scZa9DDcFOMGHB35p0pPneHzmYk49czfMEKK3RVGCON9pj2ICo6y/flm9OY7c5RBu4ZmWPpti6Z1Yf/OMeWU9cwL+BqSGPkbtWBWpyFJLIBR8FXkU+sr/+SuwYOxSbj0tHPj32unoPpCfT6rQmNOCdlD5p3O1Bsai74NlGfm4DKPaE0SesyJIQ== pid@localhost

Memory Management and Performance

JavaScript engines such as Google’s V8 (Chrome, Node) are specifically designed for the fast execution of large JavaScript applications. As you develop, if you care about memory usage and performance, you should be aware of some of what’s going on in your user’s browser’s JavaScript engine behind the scenes.

Continue reading Writing Fast, Memory-Efficient JavaScript, great general overview of a Google employee

Videos

GIT Version Control System

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Tools

@pid
pid / gist:5379270
Last active December 16, 2015 04:48
Google Bookmark Bookmarklet || page title => title || page meta description => annotation || text selection => concat to annotation
javascript: (function () {
function document_description() {
var description = '',
selection = '';
var metas = document.getElementsByTagName('meta');
if (metas) {
for (var x = 0, y = metas.length; x < y; x++) {
if (metas[x].name.toLowerCase() == "description") {
description += metas[x].content;
}
@pid
pid / asana-bookmarklet.js
Created April 18, 2013 07:32
Asana Bookmarklet
// Replace <PROJECT-ID> with your project id
javascript: var trim12 = function trim12(str) {
var str = str.replace(/^\s\s*/, ''),
ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
};
/**
* Performs a binary search on the host array. This method can either be
* injected into Array.prototype or called with a specified scope like this:
* binaryIndexOf.call(someArray, searchElement);
*
* @param {*} searchElement The item to search for within the array.
* @return {Number} The index of the element which defaults to -1 when not found.
*/
function binaryIndexOf(searchElement) {
'use strict';
@pid
pid / ssh-keygen-pkcs8.sh
Last active December 18, 2015 10:09
SSH Security
# Improving the security of your SSH private key files (
# Better key protection with PKCS#8
# http://martin.kleppmann.com/2013/05/24/improving-security-of-ssh-private-keys.html
mv ~/.ssh/id_rsa ~/.ssh/id_rsa.old
openssl pkcs8 -topk8 -v2 des3 -in ~/.ssh/id_rsa.old -out ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Check that the converted key works; if yes, delete the old one:
rm ~/.ssh/id_rsa.old
@pid
pid / jsaes.js
Created June 14, 2013 19:25
This is a javascript implementation of the AES block cipher. Key lengths of 128, 192 and 256 bits are supported. http://point-at-infinity.org/jsaes/
/*
* jsaes version 0.1 - Copyright 2006 B. Poettering
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@pid
pid / gist:5886387
Created June 28, 2013 17:17
test popup blocker
var newWindow = open("http://fiddle.jshell.net/_display/", "test"),
looplimit = 3,
x=0;
function loopy() {
if (newWindow.innerHeight > 1) {
console.log(" opened2 ");
} else {
x++;
if ( x > looplimit) {
console.log(" blocked ");
@pid
pid / gist:5908434
Created July 2, 2013 11:01
Load JavaScript from CDN, fallback: load from local webserver
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
if (typeof jQuery === "undefined") {
var script = document.createElement('script');
var attr = document.createAttribute('type');
attr.nodeValue = 'text/javascript';
script.setAttributeNode(attr);
attr = document.createAttribute('src');
attr.nodeValue = '/scripts/jquery-1.3.2.min.js';
script.setAttributeNode(attr);