Skip to content

Instantly share code, notes, and snippets.

View erhangundogan's full-sized avatar
👋

Erhan Gundogan erhangundogan

👋
View GitHub Profile
asp.net
<% if(someCondition) { %>
<ol>
<% foreach(var item in Model) { %>
<li><%: item.ToString() %></li>
<% } %>
</ol>
<% } %>
razor
// child.js
console.log('child was created with PID: ' + process.pid);
process.on('exit', function(code,signal) {
console.warn('child is exiting with code: '+ code +' and signal: '+signal)
});
process.on('message', function(data) {
console.log('child: got message from parent: ' + data);
process.send('hi, thanks for the message!');
/*
* File Operations
*/
var fs = require("fs"),
path = require("path"),
util = require("util");
exports.read = function(req, res) {
var fileName = req.params.filename;
@erhangundogan
erhangundogan / promised.js
Last active December 17, 2015 00:38
promise me request this website
// http://documentup.com/kriskowal/q/
(function() {
"use strict"
var Q = require("q"),
Request = require("request");
var delayOne = function() {
return Q.delay(100).then(function() {
from httplib import BadStatusLine
import re
import threading
import urllib2
import Queue
def GetLinks(url):
try:
# agent info
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
<!doctype html>
<html ng-app>
<head>
<script src="http://code.angularjs.org/1.2.0-rc.2/angular.min.js"></script>
<script type="text/javascript">
function formLogic($scope) {
$scope.validate = function() {
if ($scope.name && $scope.surname) {
console.log("OK");
} else {
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<script type="text/javascript">
function TodoCtrl($scope) {
$scope.todos = [
{text:'learn angular', done:true},
{text:'build an angular app', done:false}];
var ob = {"erhan":10 , "kaan":222};
var ob2 = {"erhan":21 , "kaan":23};
var ob3 = {"erhan":12 , "kaan":323};
var arrayItem = [ob,ob2,ob3];
var sortArray = function(arr, k) {
var result = [];
// arr içindeki kaan property lerinin value lerini valueArray'e atar
var valueArray = _.map(arr, function(value, key) {