Skip to content

Instantly share code, notes, and snippets.

{
"name": "svelte-app",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public"
},
"devDependencies": {
@esacteksab
esacteksab / file.yml
Created December 31, 2018 19:29
How do you handle the different fields that may exist in a yaml file w/o defining every possible component in a struct?
# this yaml file will have two key pairs.
foo: val
bar: val1

Ingredients:

1 ¼ cups buttermilk.  I have not tried this yet with substituting vinegar + milk, but I will when I run out my current bottle of buttermilk.

1 ½ cups Quaker corn meal.

½ cup King Arthur all-purpose flour

1 ½ teaspoons baking powder.  I’ve had trouble w/ generic store brands; name brand seems to work better.
In [19]: list2 = [("A", 2), ("B", 2), ("C", 3), ("D", 4), ("A", 1)]
In [20]: list2
Out[20]: [('A', 2), ('B', 2), ('C', 3), ('D', 4), ('A', 1)]
In [21]: for i in list2:
...: print(i)
...:
('A', 2)
('B', 2)

Keybase proof

I hereby claim:

  • I am esacteksab on github.
  • I am esacteksab (https://keybase.io/esacteksab) on keybase.
  • I have a public key whose fingerprint is FF19 25B5 E32E A9E9 DB4E 1A1F E09A C84F F986 DAD3

To claim this, I am signing this object:

@esacteksab
esacteksab / vim-foo.md
Last active March 27, 2020 20:59
Vim tips and tricks

To comment out a range of lines

:<start>,<end>s/^/#/g

Example

:1,10s/^/#/g

The important part is the ^ character which is the beginning of a line. The above example will comment out lines 1 - 10

import boto
#connect to s3
c = boto.connect_s3()
#get bucket
bucket = c.get_bucket('bucket_name')
#files are keys
@esacteksab
esacteksab / delete-disassociated-ip.py
Last active January 2, 2016 15:19
Delete disassociated EIP's in AWS with Boto
import boto.ec2
# Connect to region
ec2 = boto.ec2.connect_to_region('us-east-1')
# Get all disassociated IP addresses
addresses = ec2.get_all_addresses(filters={'instance-id':''})
for address in addresses:
@esacteksab
esacteksab / get_version.sh
Last active December 31, 2015 06:49
Get version from package.json (npm)
python -c "import json;json_data=open('package.json');data=json.load(json_data);print data['version'];json_data.close()"
#!/usr/bin/python
import tempfile
import fileinput
from github3 import create_gist, login
gh = login('esacteksab', 'password')
temp = tempfile.TemporaryFile()
for line in fileinput.input():
temp.write(line)