View gist:f4d170fd817b1ffc97e2
1 2 3 4 5 6 7 8 9 10
$DICTIONARY_FILE = "Main.old.strings"
$FILE_TO_TRANSLATE = "Main.strings"
$TRANSLATED_FILE = "Main.new.strings"
 
module StringsExtraction
def self.extract_english_phrase line
cleaned_up_line = line.delete "/*\n"
tokens = cleaned_up_line.split(";")
token_with_english_phrase = tokens[1]
english_phrase = token_with_english_phrase.split(" = ")[1]
View 0_reuse_code.js
1 2
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:c1ed325628eb17cb4c78
1 2 3 4 5 6 7 8 9
require 'sinatra'
 
get '/hi' do
"Hello World!"
end
 
get '/' do
erb :form
end
View gist:4a289028ea917a4b9bfd
1 2 3 4 5 6 7 8 9 10
require "spec_helper"
require "largest" # name of the class we have just created
 
describe Largest do
describe "#find_largest" do
it "finds the largest number in the array" do
largest_number = Largest.find_largest([1,4,2])
expect(largest_number).to eq(4)
end
end
View Gemfile
1 2 3 4 5
source 'https://rubygems.org'
 
group :test do
gem 'rspec'
end
View file
1 2 3 4 5 6 7 8 9 10
class Animal
{
private int life;
public int Life {
get { return life; }
set { life = value; }
}
}
 
class Dog : Animal
View gist:4a0a197819ab220563d5
1 2 3 4 5 6 7 8 9 10
Intent intent = new Intent();
intent.setComponent(new ComponentName("cng.android.timesheet", "cng.android.timesheet.Splash"));
List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() > 0){
startActivity(intent);
} else {
String url = "http://appstore.g-able.com/timesheet/";
Intent i = new Intent(Intent.ACTION_VIEW);
View gist:c477f0bdc4c45626a256
1 2 3 4 5 6 7 8 9 10
- (void)openOneMinTimesheet
{
NSString *customURL = @"OneMinTimesheet://";
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]])
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]];
}
else
{
View gist:f39a66b1e6f008f80bf2
1 2 3 4 5 6 7 8 9 10
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
 
 
public class ImageDisplay extends JFrame{
JLabel label;
JTextField name;
JButton display;
Something went wrong with that request. Please try again.