Skip to content

Instantly share code, notes, and snippets.

@klooperator
klooperator / getMoonPhase.js
Created May 12, 2018 19:30 — forked from endel/getMoonPhase.js
Get Moon Phase by Date, written in JavaScript
/*
* modified from http://www.voidware.com/moon_phase.htm
*/
function getMoonPhase(year, month, day)
{
var c = e = jd = b = 0;
if (month < 3) {
year--;
@klooperator
klooperator / framework-sizes.md
Created December 14, 2017 15:03 — forked from Restuta/framework-sizes.md
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – Angular, Ember and React.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js
@klooperator
klooperator / gist:0e437714dac8c52025ff49faabcc8d2d
Created April 16, 2017 21:34
Adding external library to Android project
In left navigation:
-Project (Project view) -> right click->New->Module->.JAR
-new folder is created -> drag n drop sources and javadoc
Go to .idea->libraries->find your library .xml
-add <SOURCES><JAVADOC> like this:
<JAVADOC><root url="jar://$PROJECT_DIR$/libraryFolder/library-javadoc.jar!/" /></JAVADOC>
Open app/build.gradle and add
compile project(':yourLibraryFolder') uder dependecies
@klooperator
klooperator / aide-github.txt
Last active February 28, 2017 19:47
AIDE github integration
Create private ssh using git bash
Save both files on android device
Save new key on github in settings->SSH
Place files on android where AIDE ssh setting is pointing to
In the same settings add github username and email
In the same directory create new file name config with no extensions
Write this to config file and save it:
Host github.com
User git
@klooperator
klooperator / redis-ve
Created January 25, 2017 20:26 — forked from pterk/redis-ve
install redis in a virtualenv
#!/bin/bash
VERSION="2.8.5"
ARCHIVE=redis-${VERSION}.tar.gz
if [ -z "${VIRTUAL_ENV}" ]; then
echo "Please activate a virtualenv first";
exit
fi
pushd /tmp/
@klooperator
klooperator / usage.js
Last active January 12, 2017 14:22 — forked from jasonfarrell/usage.js
Checks if a DOM element is visible. Takes into consideration its parents and overflow.
var my_element = document.getElementById('my-element');
//-- Returns true/false
my_element.isVisible(my_element);
@klooperator
klooperator / chromeLoginDataExporter.js
Created December 7, 2016 22:18 — forked from Ajax30/chromeLoginDataExporter.js
Export the passwords stored in your Google Chrome browser
var decryptedRow="";
var pm = PasswordManager.getInstance();
var model = pm.savedPasswordsList_.dataModel;
var pl = pm.savedPasswordsList_;
for(i=0;i<model.length;i++){
PasswordManager.requestShowPassword(i);
};
setTimeout(function(){
var bootstrapStylesheet = '<link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">';
tableStart = '<table class="table table-striped"><thead>';
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->