Skip to content

Instantly share code, notes, and snippets.

View galileoguzman's full-sized avatar
🤓
Making the world programmable

Galileo Guzmán galileoguzman

🤓
Making the world programmable
View GitHub Profile
@galileoguzman
galileoguzman / Django_ReactJS_Webpack_project_setup.md
Created August 12, 2017 16:45 — forked from Belgabor/Django_ReactJS_Webpack_project_setup.md
Set up a Django + ReactJS project with Webpack manager

Guide on how to create and set up your Django project with webpack, npm and ReactJS :)

Hopefully this will answer "How do I setup or start a Django project?" I was trying to set up my own website, and there was a lot to read, learn and digest! Therefore, I put this together which is a collection of all the guides/blog posts/articles that I found the most useful. At the end of this, you will have your barebones Django app configured and ready to start building :)

NOTE: This guide was built using Django 1.9.5, NodeJS 4+ with NPM 3+

1. Setting up your dev environment

@galileoguzman
galileoguzman / test
Created April 4, 2017 18:54
Gist file for Lidia from Incode
#import <Foundation/Foundation.h>
@interface SolutionClass : NSObject
-(NSArray*)uniqueEntriesIn:(NSArray*) list lessThan:(NSNumber*) maxValue;
-(NSDictionary<NSString*, NSNumber*>*)countClassesIn:(NSArray*)list;
@end
@implementation SolutionClass
-(NSArray*)uniqueEntriesIn:(NSArray*) list lessThan:(NSNumber*) maxValue
{
NSMutableArray* arResult = [[NSMutableArray alloc] init];
@galileoguzman
galileoguzman / floatingButton.html
Created January 27, 2017 06:06
Floating button for any call to action.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Floating Button!</title>
<style type="text/css">
*{
border: 0;
@galileoguzman
galileoguzman / format_uiTextFieldCalculator.md
Last active March 29, 2016 06:50
Trying to format a UITextField to behave like a currency calculator for only numeric input in iOS

e.g. when entering the number "1234.56".

  1. $ 0.00.

  2. $ 0.01.

  3. $ 0.12.

  4. $ 1.23.

@galileoguzman
galileoguzman / NSURLSession.MD
Created February 5, 2016 00:58
How to make common method to call api

#How to use NSURLSession

http://stackoverflow.com/questions/24851772/how-to-return-nsdata-from-nsurlsessiondatatask-completion-handler

+ (NSURLSessionDataTask *)postCall:(NSDictionary *)parameters fromURL:(NSString *)url completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler {

    // create your request here ...

    NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:urlRequest completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {

if (completionHandler)

@galileoguzman
galileoguzman / tutorial cocoa pods.MD
Last active January 27, 2016 19:25
Tutorial Cocoapods

How to use Cocoapods with ObjC

This file will help you to init project with Xcode and Objective C with pagage manager Cocoapods. The head first are make sure that we have installed Cocoapods on our system.

IMPORTANT: Make sure you have ruby cli installed on your system.

sudo gem install cocoapods

After have installed cocoapods, you have to export the environment vars for your system can to recognize cocoapods cli.

@galileoguzman
galileoguzman / django_ami.md
Created November 18, 2015 03:31 — forked from aderowbotham/django_ami.md
Django stack setup on EC2 AMI

Django Stack

Overview

This is a set of instructions to setup a Django Nginx Gunicorn MySQL/Postgres stack on a single Amazon EC2 instance.

Server - AWS

@galileoguzman
galileoguzman / unix_timestamp_python.py
Created October 28, 2015 19:02
How to convert unix timestamp to datetime python class
## IMPORT THE DATETIME MODULE
import datetime
## CONVERT THE RAW STRING WITH STRFTIME METHOD
print(
datetime.datetime.fromtimestamp(
int("1284101485")
).strftime('%Y-%m-%d %H:%M:%S')
@galileoguzman
galileoguzman / random_string_with_digits.py
Created October 27, 2015 17:10
Generate random string with digits
# function definition
def generate_public_key(self):
#import libs
import string
import random
# make magic
k = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(255)])
#return the value
@galileoguzman
galileoguzman / jquery.ajax.js
Created September 28, 2015 16:28
Example how to use AJAX function on JQUERY
$.ajax({
type : 'POST',
url : 'http://localhost/api/get/all',
data : {'token': 'some string'},
dataType: 'JSON',
cache : false,
beforeSend : function(){
//Before to send request do a animation
// ...
},