Skip to content

Instantly share code, notes, and snippets.

View faloi's full-sized avatar

Federico Aloi faloi

  • Argentina
View GitHub Profile
@faloi
faloi / claseFileSystemViernesNoche.java
Created June 7, 2014 06:12
Posible solucion (super incompleta) del problema del File System. Clase del viernes 7/6/2014
public class Buffer {
int getTamanio()
byte[] getContenido()
}
public class File {
LowLevelFileSystem fileSystem;
int fileDescriptor;
//Prueba 1
//PUT /items/MLA510849033
//Request body
{
"variations": [
{
"id": 6442277435
},
{
@faloi
faloi / makefile
Created June 24, 2014 15:20
Huffman Compressor's Makefile
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
{
"id": "53aad9cca4d39654293978f9",
"name": "TPI Estado Cursada",
"desc": "",
"descData": null,
"closed": false,
"idOrganization": null,
"invited": false,
"pinned": true,
"starred": true,
-- Foreign keys
use INFORMATION_SCHEMA;
select constraint_name, TABLE_NAME, REFERENCED_TABLE_NAME
from KEY_COLUMN_USAGE
where REFERENCED_TABLE_NAME is not null
-- Count of foreign keys with "FK_" prefix
use INFORMATION_SCHEMA;
select count(*)
from KEY_COLUMN_USAGE

Foreign keys

Rename

-- 1. Just the object name as seen in sys.objects:
sp_rename 'FK_Product_Caetgory', 'FK_Product_Category', 'OBJECT'
 
-- 2. Qualified with  the schema:
sp_rename 'Shopping.FK_Product_Caetgory', 'FK_Product_Category', 'OBJECT'
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using FluentMigrator.Model;
using FluentMigrator.SchemaDump.SchemaWriters;
namespace SampleApplication.SchemaDump
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
@faloi
faloi / UnViewModel.java
Created September 8, 2014 02:50
Ejemplo simple del uso de RadioSelector en Arena
package ui;
import org.uqbar.commons.utils.Observable;
import java.util.Arrays;
import java.util.List;
@Observable
public class UnViewModel {
private String nombreSeleccionado;
@faloi
faloi / push_git_repos.sh
Last active August 29, 2015 14:06
Scans all Git repositories at the given path and outputs those who have uncommited changes
#!/bin/bash
# Update all git directories below current directory or specified directory, asking for confirmation
function ask_yes_or_no() {
read -p "$1 ([y]es or [N]o): "
case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac