Skip to content

Instantly share code, notes, and snippets.

View clystian's full-sized avatar

Cristian Hernandez clystian

View GitHub Profile
@shane-powell
shane-powell / ClassGenerator.sql
Last active April 14, 2020 11:27
Generate C# class from database table (Implementing INotifyPropertyChanged)
--Forked from SO: http://stackoverflow.com/questions/5873170/generate-class-from-database-table
declare @TableName sysname = 'TableNameHere'
declare @Result varchar(max) = 'using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
public class ' + @TableName + ' : INotifyPropertyChanged
{
'
@alexrainman
alexrainman / Connectivity.cs
Last active March 27, 2023 07:45 — forked from emil2k/Connectivity.java
Check device's network connectivity and speed for Xamarin.Android
using System.Threading;
using Android.Content;
using Android.Net;
using Android.Telephony;
using Java.IO;
using Java.Net;
namespace YourNamespace {
/**
@cstephe
cstephe / backspacedirective
Last active March 9, 2021 02:15
Angular directive: prevent backspace from acting like the back button
.directive('backSpaceNotBackButton', [function(){
return {
restrict: 'A',
link: function(scope, element, attrs){
// This will stop backspace from acting like the back button
$(element).keydown(function (e) {
var elid = $(document.activeElement)
.filter(
"input:not([type], [readonly]),"+
"input[type=text]:not([readonly]), " +
@ruby0x1
ruby0x1 / multi-player-html5-games-00-express.js
Created March 27, 2012 15:01
Multi-player games in HTML5
/* Copyright (c) 2012 Sven "FuzzYspo0N" Bergström
http://underscorediscovery.com
MIT Licensed. See LICENSE for full license.
Usage : node simplest.app.js
*/
var
CREATE OR REPLACE FUNCTION from_unixtime(integer) RETURNS timestamp AS '
SELECT to_timestamp($1)::timestamp AS result
' LANGUAGE 'SQL';