Skip to content

Instantly share code, notes, and snippets.

Ledger Nano X : Bluetooth Low Energy Communication

1.0

  • Public release

About

@ajamaica
ajamaica / web-servers.md
Created August 24, 2020 02:02 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

Keybase proof

I hereby claim:

  • I am ajamaica on github.
  • I am ajamaica (https://keybase.io/ajamaica) on keybase.
  • I have a public key whose fingerprint is 0372 0E83 FFF7 AA05 E537 D828 FA2D 63E3 45C2 BD8E

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ajamaica on github.
  • I am ajamaica (https://keybase.io/ajamaica) on keybase.
  • I have a public key whose fingerprint is 9021 115C 215C 1F17 36E2 D338 14A5 450C 7363 D3D8

To claim this, I am signing this object:

curl -sL https://deb.nodesource.com/setup_5.x -o nodesource_setup.sh
sudo -E bash ./nodesource_setup.sh
sudo apt-get install -y nodejs build-essential git
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start
git clone https://github.com/ParsePlatform/parse-server-example.git
@ajamaica
ajamaica / gist:a2a4d6ac2c783118d734
Last active January 18, 2016 16:07
Ransom Note
import string
#!/usr/bin/env python
def ransom_note(revistas,ransom):
catalogo = dict()
for letra in revistas:
if not letra in catalogo.keys():
catalogo[letra] = 1
else:
public static void setListViewHeightBasedOnChildren(ListView listView)
{
ListAdapter listAdapter = listView.getAdapter();
if(listAdapter == null) return;
if(listAdapter.getCount() <= 1) return;
int desiredWidth = MeasureSpec.makeMeasureSpec(listView.getWidth(), MeasureSpec.AT_MOST);
int totalHeight = 0;
View view = null;
for(int i = 0; i < listAdapter.getCount(); i++)
[
{
"__type__": "LevelPost",
"code": "5565-0000-006F-C737",
"pictures": [],
"timestamp": 1443726849.0,
"title": "My boyfriend made a couple of levels. He's really into storytelling and not typically a fan of platformers, so his way of putting a level together is quite interesting.",
"url": "https://www.reddit.com/r/MarioMaker/comments/3n4z2d/my_boyfriend_made_a_couple_of_levels_hes_really/"
},
{
@ajamaica
ajamaica / gist:8d6ba913c94c604b6900
Created April 6, 2015 19:51
setListViewHeightBasedOnChildren
public static void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
// pre-condition
return;
}
int totalHeight = listView.getPaddingTop() + listView.getPaddingBottom();
for (int i = 0; i < listAdapter.getCount(); i++) {
View listItem = listAdapter.getView(i, null, listView);
#palabras = ["nintendo","xbox","wii u","playstation 4"]
#for palabra in palabras :
# print palabra, len(palabra)
#for i in range(-100,1001):
# print "No - %i" % i
palabras = ["nintendo","xbox","wii u","playstation 4"]
for palabra in palabras :
print palabra