Showing latest added snippets.

Scaffold - Snippet icon Scaffold
  1. rails generate scaffold assessment name:string enabled:boolean After_assessment:boolean selected_date:boolean from_date:date to_date:date show_After_assessment:integer ordinal?number:integer created_by:integer updated_by:integer
  2.  
  3. rails g scaffold assessment_type name:string enabled:boolean note:text ordinal?number:integer created_by:integer updated_by:integer assessment:belongs_to
  4.  
  5. rails g migrati
See the complete snippet
Language: Ruby on Rails
Tags:
Submitted By: saed.sukkar
Heroku Task - Snippet icon Heroku Task
  1. touch lib/tasks/ping.rake
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. require 'net/http'
  9.  
  10. namespace :ping do
  11. desc "Ping our heroku dyno every 10, 60 or 3600 min"
  12. task :start do
  13. puts "Making the attempt to ping the dyno"
  14.  
  15. if ENV['URL']
  16. puts "Sending ping"
  17.  
  18. uri = URI(ENV['URL'])
  19. Net::HTTP.get_response(uri)
  20.  
  21. puts "success..."
  22. end
  23. end
  24. end
  25.  
  26.  
  27.  
  28.  
  29. heroku run rake ping:start
See the complete snippet
Language: Ruby
Tags:
Submitted By: saed.sukkar
Create DB - Snippet icon Create DB
  1. CREATE USER "Unison" WITH PASSWORD ‘U123456798';
  2. CREATE DATABASE "Unison_test" WITH ENCODING='UTF8';
  3. GRANT ALL PRIVILEGES ON DATABASE "Unison_test" to "Unison";
  4.  
See the complete snippet
Language: Postgresql
Tags:
Submitted By: saed.sukkar
??????????? ????? ?? ???? - Snippet icon ??????????? ????? ?? ????
  1. public static void main(String[] args) throws Exception
  2. {
  3. //??????? ?????-??????-????-??-?????
  4. FileInputStream inputStream = new FileInputStream("c:/data.txt");
  5. // ??????? ?????-??????-????-?-????
  6. FileOutputStream outputStream = new FileOutputStream("c:/result.txt");
  7.  
  8. while (inputStream.available() > 0) //???? ???? ??? ????????????? ?????
  9. {
  10. int data = inputStream.read(); // ????????? ?????
See the complete snippet
Language: Java
Tags:
Submitted By: dmitriy.laletin
Untitled Snippet - Snippet icon Untitled Snippet
  1. http://chart.apis.google.com/chart?cht=qr&chs=500x500&choe=UTF-8&chld=H|0&chl=https://goo.gl/GbVQu8
See the complete snippet
Language: Other
Tags:
Submitted By: PiarasJ
??????? ?????? ????? - Pattern Wrapper - Snippet icon ??????? ?????? ????? - Pattern Wrapper
  1. public static void main(String[] args) throws IOException
  2. {
  3. //?????? ?????? ? ??????
  4. StringBuilder sb = new StringBuilder();
  5. sb.append("Lena").append('\n');
  6. sb.append("Olya").append('\n');
  7. sb.append("Anya").append('\n');
  8. String data = sb.toString();
  9.  
  10. //??????????? ?????? ? ????? ByteArrayInputStream
  11. InputStream is = new ByteArrayInputStream(data.getBytes());
  12.  
  13. //????????? in
  14. System.setIn(
See the complete snippet
Language: Java
Tags:
Submitted By: dmitriy.laletin
Objective-C Starter - Snippet icon Objective-C Starter
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main (int argc, const char * argv[]) {
  4. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  5.  
  6. NSLog(@"Hello World");
  7. [pool release];
  8. return 0;
  9. }
See the complete snippet
Language: Objective-C
Tags:
Submitted By: Lippoli
Java Starter - Snippet icon Java Starter
  1. class HelloWorld {
  2. public static void main(String args[]) {
  3. System.out.print("Hello World");
  4. }
  5. }
See the complete snippet
Language: Java
Tags:
Submitted By: Lippoli
C Starter - Snippet icon C Starter
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. printf("Hello World");
  5. return 0;
  6. }
See the complete snippet
Language: C
Tags:
Submitted By: Lippoli
PHP Starter - Snippet icon PHP Starter
  1. <?php
  2. print "Hello World";
  3. ?>
See the complete snippet
Language: PHP
Tags:
Submitted By: Lippoli
moment - Snippet icon moment
  1. moment("12-25-1995", "MM-DD-YYYY");
  2.  
  3. moment().format("YYYY?MM?DD? HH:mm");
See the complete snippet
Language: Other
Tags:
Submitted By: oopfuture
Language: Objective-C
Tags:
Submitted By: mikruli
Adding Bundles - Snippet icon Adding Bundles
  1. Code Collector Pro allows you to add bundles to expand the list of languages available allowing them to have their syntax coloured. Code Collector Pro supports TextMate bundles, which are available from the online bundle respository (http://macromates.com/svn/Bundles/trunk/). Once you have downloaded a bundle you can add it by going into Preferences and clicking on the + button in the bundles sect
See the complete snippet
Language: Other
Tags:
Submitted By: mikruli
HTML 4.01 Transitional - Snippet icon HTML 4.01 Transitional
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>untitled</title>
  6. </head>
  7.  
  8. </body>
  9. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: mikruli
Java Starter - Snippet icon Java Starter
  1. class HelloWorld {
  2. public static void main(String args[]) {
  3. System.out.print("Hello World");
  4. }
  5. }
See the complete snippet
Language: Java
Tags:
Submitted By: mikruli
Objective-C Starter - Snippet icon Objective-C Starter
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main (int argc, const char * argv[]) {
  4. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  5.  
  6. NSLog(@"Hello World");
  7. [pool release];
  8. return 0;
  9. }
See the complete snippet
Language: Objective-C
Tags:
Submitted By: mikruli
XHTML 1.0 Strict - Snippet icon XHTML 1.0 Strict
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title>untitled</title>
  7. </head>
  8.  
  9. </body>
  10. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: mikruli
C Starter - Snippet icon C Starter
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. printf("Hello World");
  5. return 0;
  6. }
See the complete snippet
Language: C
Tags:
Submitted By: mikruli
HTML 4.01 Strict - Snippet icon HTML 4.01 Strict
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html lang="en">
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>untitled</title>
  6. </head>
  7.  
  8. </body>
  9. </html>
See the complete snippet
Language: HTML
Tags:
Submitted By: mikruli

Web Analytics