Skip to content

Instantly share code, notes, and snippets.

function EditCard({title, description, onConfirm, onCancel}) {
return (
<div>
<div>
<Icon>
<DocumentSVG />
</Icon>
<h1>{title}</h1>
<IconButton onClick={onCancel}>
<CloseSVG />
@leonsomed
leonsomed / mongo-import.bash
Created March 4, 2019 18:48
import csv to mongodb
#!/bin/bash
mongoimport --host=127.0.0.1 -d dbName -c collectionName --type csv --file filename.csv --headerline --columnsHaveTypes
@leonsomed
leonsomed / xls2csv.bash
Created March 4, 2019 18:44
xls to csv libreoffice
#!/bin/bash
sudo libreoffice --headless --convert-to csv filename.xlsx --outdir csv
@leonsomed
leonsomed / launch.json
Created January 12, 2019 22:10
node.js debug launcher for nvm
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/src/index.js",
"runtimeExecutable": "~/.nvm/versions/node/v8.11.3/bin/node"
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://unpkg.com/normalize.css@^7.0.0" rel="stylesheet" />
<link href="https://unpkg.com/@blueprintjs/core@^3.0.0/lib/css/blueprint.css" rel="stylesheet" />
<link href="https://unpkg.com/@blueprintjs/icons@^3.0.0/lib/css/blueprint-icons.css" rel="stylesheet" />
@leonsomed
leonsomed / dom-scanner.js
Created June 6, 2017 20:40
Scan DOM attribute changes changes
var scan = (function(attributes){
var hashes = {},
counter = 100000,
CUSTOM_ID_ATTR = 'custom-id-attr-' + (Math.random() * 10000)
function scan(root) {
// if no root element provided then use the body element
root = root ? root : document.getElementsByTagName('body')[0]
var all = root.getElementsByTagName("*"),
#!/bin/sh
##
# Apache HTTP Server
##
. /etc/rc.common
mysqlPath="/Library/Application Support/appsolute/MAMP PRO/db/mysql"
mysqlTmpPath=/Applications/MAMP/tmp/mysql
@leonsomed
leonsomed / ps-export-layers-to-png.jsx
Created March 28, 2016 04:12 — forked from tomekc/ps-export-layers-to-png.jsx
Photoshop script that exports to PNG all layers and groups whose names end with ".png".
#target photoshop
// $.level = 2;
/*
* Script by Tomek Cejner (tomek (at) japko dot info)
* based on work of Damien van Holten:
* http://www.damienvanholten.com/blog/export-groups-to-files-photoshop/
*
* My version adds support of nested layer groups,
* and exports single layers in addition to groups.
@leonsomed
leonsomed / AnimatedListView.java
Created March 26, 2016 23:26
AnimatedListView Android
package com.leonziyo.imagegallery;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;