Skip to content

Instantly share code, notes, and snippets.

View RacZo's full-sized avatar
Turning caffeine into code

Oscar Salguero RacZo

Turning caffeine into code
View GitHub Profile
@ubergesundheit
ubergesundheit / VIN.java
Created May 22, 2013 10:39
VIN validator/decoder
public class VIN {
//from http://introcs.cs.princeton.edu/java/31datatype/VIN.java.html
public static boolean isVinValid(String vin) {
int[] values = { 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 0, 7, 0, 9,
2, 3, 4, 5, 6, 7, 8, 9 };
int[] weights = { 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 };
@davidstump
davidstump / touch.coffee
Created May 1, 2013 23:42
Simple class to handle touch events and emit them to your application. Utilizes EventEmitter.
@Touch=
horizontal_sensitivity: 22
vertical_sensitivity: 6
touchDX: 0
touchDY: 0
touchStartX: 0
touchStartY: 0
bind: (elements...) ->
@t2-support-gists
t2-support-gists / DC.jsp
Last active October 10, 2015 17:08
DC Java RESTFul App 1
<!--
Licensed by AT&T under 'Software Development Kit Tools Agreement.' September 2011
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
Copyright 2011 AT&T Intellectual Property. All rights reserved. http://developer.att.com
For more information contact [email protected]
-->
<%
response.addHeader("P3P", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
%>
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
@t2-support-gists
t2-support-gists / README.txt
Created July 16, 2012 23:21
TL Java RESTFul App 1
<!--
Licensed by AT&T under 'Software Development Kit Tools Agreement.'
2013 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION:
http://developer.att.com/sdk_agreement/ Copyright 2013 AT&T Intellectual
Property. All rights reserved. http://developer.att.com For more information
contact [email protected] -->
-->
AT&T API Platform Sample Application
-------------------------------------
anonymous
anonymous / gist:2912227
Created June 11, 2012 19:44
php slugify string
<?php
function slugify($str) {
$search = array('Ș', 'Ț', 'ş', 'ţ', 'Ş', 'Ţ', 'ș', 'ț', 'î', 'â', 'ă', 'Î', 'Â', 'Ă', 'ë', 'Ë');
$replace = array('s', 't', 's', 't', 's', 't', 's', 't', 'i', 'a', 'a', 'i', 'a', 'a', 'e', 'E');
$str = str_ireplace($search, $replace, strtolower(trim($str)));
$str = preg_replace('/[^\w\d\-\ ]/', '', $str);
$str = str_replace(' ', '-', $str);
return preg_replace('/\-{2,}', '-', $str);
}
@cstrahan
cstrahan / SolarInfo.cs
Created January 6, 2011 05:06
A sunrise/sunset calculator.
using System;
using System.Diagnostics;
namespace SunriseCalculator
{
public class SolarInfo
{
public double SolarDeclination { get; private set; }
public TimeSpan EquationOfTime { get; private set; }
public DateTime Sunrise { get; private set; }