Skip to content

Instantly share code, notes, and snippets.

View MatiMenich's full-sized avatar
🎯
Focusing

Matías Menich MatiMenich

🎯
Focusing
View GitHub Profile
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@dbankier
dbankier / gulpfile.js
Created July 6, 2015 08:27
Nativescript with Jade, SCSS and Babel
// modified from this: https://github.com/emiloberg/nativescript-emulator-reload
// all sources
var babelSrc = [ 'src/**/*.js', '!src/tns_modules', '!src/tns_modules/**', '!src/node_modules', '!src/node_modules/**' ];
var jadeSrc = [ 'src/**/*.jade' ];
var sassSrc = [ 'src/**/*.scss' ];
var resources = [ 'src/{App_Resources,tns_modules,node_modules}/**', 'src/package.json'];
// Which emulator to run?
@romanz
romanz / fullnode.md
Last active March 20, 2024 19:05
Bitcoin Full Node on AWS Free Tier

Bitcoin Full Node on AWS Free Tier

Provisioning

  • Launch one T2 micro instance, using Ubuntu 14.04 LTS AMI.
  • Open SSH and Bitcoin Protocol TCP ports: 22, 8333.
  • Attach 40GB EBS (General-Purpose SSD) volume for blockchain storage to /dev/sdf.

The pricing should be ~3$ for the first year (assuming 30GB upload per month). See here for more details.

@charliepark
charliepark / contrasting_text_color.rb
Created July 18, 2010 12:03
calculate contrast color in Ruby
def convert_to_brightness_value(background_hex_color)
(background_hex_color.scan(/../).map {|color| color.hex}).sum
end
def contrasting_text_color(background_hex_color)
convert_to_brightness_value(background_hex_color) > 382.5 ? '#000' : '#fff'
end