Skip to content

Instantly share code, notes, and snippets.

View aflores's full-sized avatar

Armando Flores aflores

View GitHub Profile
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hey!"
message: [NSString stringWithFormat:@" you clicked on '%@'", name]
delegate: nil cancelButtonTitle: @"OK" otherButtonTitles:nil];
[alert show];
[alert release];
@aflores
aflores / Msg
Created April 15, 2011 16:26
Msg
<div style="width:80%;font-family:arial;padding:10px;background-color:#e2da9b;color:black;font-size:small;text-align:center;border:solid 2px #f00">
This site will be down for scheduled maintenance between:</br></br>
Friday 04/15 9:00 PM and Saturday 04/16 7:00 AM
</div>
@aflores
aflores / gist:9858703
Created March 29, 2014 17:38
Arduino hopscotch
/* Ping))) Sensor
This sketch reads a PING))) ultrasonic rangefinder and returns the
distance to the closest object in range. To do this, it sends a pulse
to the sensor to initiate a reading, then listens for a pulse
to return. The length of the returning pulse is proportional to
the distance of the object from the sensor.
The circuit:
* +V connection of the PING))) attached to +5V
@aflores
aflores / gist:4453336b3f352da0aa8b
Created November 4, 2014 00:04
javascript clock
----
In ASP.NET CODE
HttpCookie cookie = Request.Cookies["OldCookieName"];
cookie.Values["CompanyID"] = Convert.ToString(CompanyId);
Response.SetCookie(cookie); //SetCookie is used for update the cookies.
Response.Cookie.Add(cookie); //This is used for Add cookies.
----
In the page where you want to show the clock
@aflores
aflores / ViewController.swift
Created November 7, 2015 03:43
Map Demo iOS9 Udemy
//
// ViewController.swift
// Map Demo
//
// Created by Armando Flores on 11/6/15.
// Copyright © 2015 Armando Flores. All rights reserved.
//
import UIKit
import MapKit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-2.0.3.js"></script>
</head>
<body>
<div id="tagButtons"><ul></ul></div>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-2.0.3.js"></script>
<style id="jsbin-css">
#cstagButtons ul {
list-style-type: none;
@aflores
aflores / youtubedownloader.scpt
Created August 20, 2017 16:05
AppleScript file to download youtube videos
(*
script to download videos from youtube using the youtube-dl program
you can paste this code in a ScriptEditor file or use it inside a
'Run AppleScript' block in an Automator Application
*)
set question to display dialog "Youtube URL to fetch?" default answer "" buttons {"Cancel", "Open in Browser", "Download"} default button 3
set pageURL to (text returned of result)
if pageURL is "" then return "No URL"
set choice to (button returned of question)
defmodule HitCountAgent do
use Agent
@docmodule """
This is the agen based implementation of a counter
"""
@doc """
hitPid = HitCountAgent.start()