Skip to content

Instantly share code, notes, and snippets.

View csfelipe's full-sized avatar
🍀
It's all good

Felipe C. csfelipe

🍀
It's all good
View GitHub Profile
@csfelipe
csfelipe / RaceConditionExample-Mutex.c
Created February 21, 2021 22:57
This is the C program with mutex displayed in the lecture "6.2.4. Example of race condition" in the UC3M course "Cybersecurity: A hands-on approach"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
void *add_function();
int addMul = 0;
pthread_mutex_t lock;
main() {
pthread_t thread;
@csfelipe
csfelipe / RaceConditionExample.c
Created February 21, 2021 22:57
This is the C program without mutex displayed in the lecture "6.2.4. Example of race condition" in the UC3M course "Cybersecurity: A hands-on approach"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
void *add_function();
int addMul = 0;
main() {
pthread_t thread;
int ret[70];
@csfelipe
csfelipe / Lab49.playground
Created April 16, 2020 21:51
This was the first round test I did for Lab49 in NY. I pretty much bombed it because of some silly mistakes. I did have 15 min for 21 questions. I added some personal remarks on possible thought process for some questions, just look for "EVAL_NOTE:"
import UIKit
// Options #2
// a) Program Crashes
// b) [1,2,3,4]
// c) [1,2,5,4] (X)
func question2() {
var originalArray = [1,2,3,4]
var secondArray = originalArray
secondArray[2] = 5
@csfelipe
csfelipe / Lab49.playground
Created April 16, 2020 21:48
This was the first round test I did for Lab49 in NY.
import UIKit
// Options #2
// a) Program Crashes
// b) [1,2,3,4]
// c) [1,2,5,4] (X)
func question2() {
var originalArray = [1,2,3,4]
var secondArray = originalArray
secondArray[2] = 5
@csfelipe
csfelipe / GIiPhoneIconGenerator.sh
Created November 26, 2015 12:32
Gets a "source" icon file and creates new one with the specific name and dimensions
# icon names
icon_names=("icon-29@1x.png" "icon-29@2x.png" "icon-29@3x.png" "icon-40@1x.png" "icon-40@2x.png" "icon-40@3x.png" "icon-60@1x.png" "icon-60@2x.png" "icon-60@3x.png")
# icon sizes
icon_size=(29 58 87 40 80 120 60 120 180)
directory_path="$PWD"
source_file="$directory_path/icon.png"
incomplete_command="cp $source_file $directory_path/"
#echo $directory_path
#echo $source_file
//
// UIFont+SFUIDisplay.swift
//
// Created by Felipe Gringo on 11/26/15.
// Copyright © 2015 Gringo, Inc. All rights reserved.
//
import Foundation
import UIKit