Skip to content

Instantly share code, notes, and snippets.

View joeldenning's full-sized avatar
🎯
Focusing

Joel Denning joeldenning

🎯
Focusing
View GitHub Profile
@tomcask
tomcask / draftjs-create-blocks-with-Image.js
Created December 23, 2016 08:19
Create draftjs blocks with images
const createBlocksWithImage = ()=>{
const url = "https://www.google.es/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png";
const entityKey = Entity.create( 'image', 'IMMUTABLE', { src: url } );
const charData = CharacterMetadata.create({ entity: entityKey })
const blockSpec = {
type : 'atomic',
text : ' ',
key: genKey(),
depth: 0,
characterList: List(Repeat(charData, 1))
//
// Case 1
//
var a = [];
var t = performance.now();
for (var i = 0; i < 10000; i++)
a.push(new Promise(function(){}));
@jadeatucker
jadeatucker / HOWTODMG.md
Last active November 2, 2024 15:02
How to create a "DMG Installer" for Mac OS X

Creating a "DMG installer" for OS X

A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.

##Creating the DMG file #Disk Utility

@thomseddon
thomseddon / gist:4703968
Last active September 9, 2024 04:24
Auto Expanding/Grow textarea directive for AngularJS
/**
* The MIT License (MIT)
*
* Copyright (c) 2013 Thom Seddon
* Copyright (c) 2010 Google
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",