Skip to content

Instantly share code, notes, and snippets.

Avatar

Emilio Rios emilioriosvz

View GitHub Profile
@paladini
paladini / aws-ec2-redis-cli.md
Last active Jan 25, 2021 — forked from todgru/aws-ec2-redis-cli.md
AWS redis-cli without redis server on AWS EC2
View aws-ec2-redis-cli.md

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

@adamgibbons
adamgibbons / install-mongodb.md
Last active Nov 19, 2020
Install MongoDB on Mac OS X 10.9
View install-mongodb.md

Install MongoDB with Homebrew

brew install mongodb
mkdir -p /data/db

Set permissions for the data directory

Ensure that user account running mongod has correct permissions for the directory:

@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active Jan 26, 2021
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
View Git push deployment in 7 easy steps.md
@lukehedger
lukehedger / gWebFont.css
Last active Apr 6, 2017
Stylus + Google Web Fonts
View gWebFont.css
/* Here's the compiled CSS */
@import url("http://fonts.googleapis.com/css?family=Droid+Sans");
body {
font-family: Droid Sans, Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 25px;
font-weight: 300;
color: #444;
}
@consti
consti / hosts
Last active Jan 24, 2021
/etc/hosts to block shock sites etc.
View hosts
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
View Ejercicio1.java
// Haz un programa en Java obtenga la fecha actual del sistema y
// a. Permita obtener por separado y lo muestre por consola: el día del mes,
// el día de la semana y la hora (formato 24h). Revisa la documentación
// de las clases java.util.Calendar, java.util.GregorianCalendar para
// llevar a cabo este apartado. Por ejemplo si la fecha actual del
// sistema es Fri Aug 30 16:05:13 CEST 2013, la salida por consola sería
// Día del mes: 30
// Día de la semana: 6
// Hora del día (24Hrs): 16
// b. Permita añadir un mes a la fecha actual y muestre la fecha calculada
@chrisjdavis
chrisjdavis / gist:4046787
Created Nov 9, 2012
Passbook server API
View gist:4046787
<?php
class PassAPI extends Plugin
{
# Registration
# register a device to receive push notifications for a pass
#
# POST /v1/devices/<deviceID>/registrations/<typeID>/<serial#>
# Header: Authorization: ApplePass <authenticationToken>
# JSON payload: { "pushToken" : <push token, which the server needs to send push notifications to this device> }
#
@garth
garth / log.js
Created May 1, 2012
Wasted quite a bit of time today trying to get flatiron winston configured with custom levels and colors, so here's a working sample.
View log.js
var winston = require('winston')
require('winston-mongodb')
// prepare some custom log levels
var customLevels = {
levels: {
debug: 0,
info: 1,
warning: 2,
error: 3
@keeguon
keeguon / countries.json
Created Apr 5, 2012
A list of countries in JSON
View countries.json
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@bmitchelmore
bmitchelmore / inplace-radix.js
Created Feb 28, 2012
In Place Radix Sort in Javascript
View inplace-radix.js
var nums = [35, 25, 53, 3, 102, 203, 230, 1005];
// Figure out the number of binary digits we're dealing with
var k = Math.max.apply(null, nums.map(function(i) {
return Math.ceil(Math.log(i)/Math.log(2));
}));
for (var d = 0; d < k; ++d) {
for (var i = 0, p = 0, b = 1 << d, n = nums.length; i < n; ++i) {
var o = nums[i];