This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var webserver = require('gulp-webserver'); | |
gulp.task('webserver', function() { | |
gulp.src('./') | |
.pipe(webserver({ | |
livereload: true, | |
directoryListing: true, | |
open: true | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$transaction = Yii::app()->db->beginTransaction(); | |
try { | |
if (!$model->save()) { | |
throw new Exception('Model cannot be saved.'); | |
} | |
if (!$anothermodel->save()) { | |
throw new Exception('Anothermodel cannot be saved.'); | |
} | |
$transaction->commit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install php5-mcrypt | |
mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/ | |
php5enmod mcrypt | |
service apache2 restart | |
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl | |
sudo service apache2 restart | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isClient) { | |
//other client side codes | |
function logRenders () { | |
_.each(Template, function (template, name) { | |
var oldRender = template.rendered; | |
var counter = 0; | |
template.rendered = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[self playVideo:@"http://www.youtube.com/v/WL2l_Q1AR_Q" frame:CGRectMake(20, 70, 280, 250)]; | |
- (void)playVideo:(NSString *)urlString frame:(CGRect)frame | |
{ | |
NSString *embedHTML = @"\ | |
<html><head>\ | |
<style type=\"text/css\">\ | |
body {\ | |
background-color: transparent;\ | |
color: white;\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gameStart | |
gameStop | |
gamePlayPause | |
gameOver | |
gameFinish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string str = string.Empty; | |
Console.WriteLine("Enter a String"); | |
string s = Console.ReadLine(); | |
int i = s.Length; | |
for (int j = i - 1; j >= 0; j--) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class ManualIntegerArraySorting | |
{ | |
public static void Main() { | |
int[] arr = new int[10]{5,3,9,5,4,1,3,56,234,1}; | |
int smallest, pointer, tmp; | |
for(int i=0; i<10; i++){ | |