Skip to content

Instantly share code, notes, and snippets.

@ariellephan
ariellephan / cron_clean.sh
Created May 24, 2012 23:35
Shell script to keep system clean
#!/bin/bash
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
YELLOW="\033[1;33m"
RED="\033[0;31m"
ENDCOLOR="\033[0m"
@ariellephan
ariellephan / bodyHtml.txt
Last active March 25, 2021 05:15
updated bodyHtml
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\" style=\"background-color: #F9FAFB; height: 100%; min-width: 100%; line-height: 22px;\">\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n <meta name=\"MobileOptimized\" content=\"320\">\n <meta name=\"HandHeldFriendly\" content=\"true\">\n <title></title>\n <!-- from source/views/emails/assembled to public/css -->\n <style>\n@media (min-width: 768px) {\n .expandable.expanded {\n max-height: 1000px;\n }\n}\n\n\n@media only screen and (-webkit-min-device-pixel-ratio: 2) {\n .dragHandle .thumb {\n background-image: u
@ariellephan
ariellephan / launch.json
Last active September 17, 2020 10:09
nodejs vscode
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8000",
"webRoot": "${workspaceFolder}/src/core/",
"sourceMaps": true,
@ariellephan
ariellephan / latency.txt
Created August 17, 2019 07:50 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ariellephan
ariellephan / README.md
Created July 5, 2018 05:02 — forked from kerryboyko/README.md
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@ariellephan
ariellephan / README.md
Created July 5, 2018 05:02 — forked from kerryboyko/README.md
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@ariellephan
ariellephan / modern-js-patterns
Last active August 28, 2017 22:40
JavaScript Patterns in Redux, Vue, etc
//Factory and Decorator
https://medium.com/@tomchentw/redux-universal-576fb9475b5b
https://github.com/redux-saga/redux-saga
https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841
//Singleton
https://medium.com/@cymen/redux-and-the-store-dd9de854d5be
//Command
https://medium.com/front-end-developers/the-command-pattern-c51292e22ea7
//Optional Default params
//es6
function myFunc({name = 'Default user', age = 'N/A'} = {}) {
}
//es5 via babeljs.io
'use strict';
function myFunc() {
@ariellephan
ariellephan / handlebarsHelpers.js
Created February 22, 2017 00:58
Handlebars Helpers
Handlebars.registerHelper('compare', function (lvalue, operator, rvalue, options) {
var operators, result;
if (arguments.length < 3) {
throw new Error("Handlerbars Helper 'compare' needs 2 parameters");
}
if (options === undefined) {
options = rvalue;
@ariellephan
ariellephan / keymap.cson
Created February 7, 2017 00:30
Enable emmets in handlebars, react for Atom
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
'atom-text-editor[data-grammar="text html mustache"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
'atom-text-editor[data-grammar="text html handlebars"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'