Skip to content

Instantly share code, notes, and snippets.

@RameshRM
RameshRM / gist:310d97c6813908ff9b0e
Created October 16, 2014 04:14
Hello World Alert w/UIAlertView
var myAlertView = UIAlertView()
myAlertView.title = "Test"
myAlertView.message = "Hello, world!"
myAlertView.addButtonWithTitle("Dismiss")
myAlertView.show()
@RameshRM
RameshRM / BackgroundFetch.swift
Last active March 8, 2022 14:36
Swift Background Fetch
Step 1: Enable capabilities "background fetch"
Step2 : Setup AppDelegate.swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Alert, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(settings)
UIApplication.sharedApplication().setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum)
return true;
ellipse(200, 50, 100, 100);
ellipse(200, 200, 200, 200);
line(10, 100, 100, 200);
//ellipse(200, 300, 50, 50);
ellipse(180, 40, 10, 10); //eye
ellipse(215, 40, 10, 10);
line(400, 100, 300, 200);
line(115, 250, 70, 400);
line(285, 250, 370, 400);
ellipse(200, 80, 40, 10);
function wordcount(paragraph) {
var totalSpaces = 0;
var letter;
for (var i = 0; i < paragraph.length; i++) {
letter = paragraph.substr(i, 1);
if (letter === ' ') {
totalSpaces = totalSpaces + 1;
}
}
var Canvas = require('canvas')
, Image = Canvas.Image
, canvas = new Canvas(200, 200)
, ctx = canvas.getContext('2d');
ctx.font = '30px Impact';
ctx.rotate(.1);
ctx.fillText("Awesome!", 50, 100);
var te = ctx.measureText('Awesome!');
var fs = require('fs');
var Canvas = require('canvas')
, Image = Canvas.Image
, canvas = new Canvas(400, 600)
, ctx = canvas.getContext('2d');
var te = ctx.measureText('Awesome!');
ctx.strokeStyle = 'rgba(0,0,0,0.5)';
ctx.beginPath();
created
deleted
forced
base_ref
compare
******************************
commits.0
******************************
commits.0.distinct
'use strict';
var util = require('util');
var async = require('async');
function FeatureStrategy(values) {
this._values = values;
this._strategyId;
}
FeatureStrategy.prototype.resolve = function (context) {
mvn archetype:generate -DgroupId=com.rameshrm -DartifactId=service-client -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
/** Runnable w/a Private Variable **/
package com.api.specs;
/**
* Hello world!
*
*/
public class App {
public static void main(String[] args) {