This file contains hidden or 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 bools = {}; | |
| function check1(){ | |
| // do something | |
| bools['check1'] = condition1; | |
| finalChek(); | |
| } | |
| function check2(){ | |
| // do other things | |
| bool['check2'] = condition2); |
This file contains hidden or 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 async = require('async'); | |
| var bools = {}; | |
| function check1(){ | |
| // do something | |
| bools['check1'] = condition1; | |
| } | |
| function check2(){ | |
| // do other things | |
| bools['check2'] = condition2; |
This file contains hidden or 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
| angular.module('app', []) | |
| .controller('ItemsCtrl', function($scope, $http){ | |
| $scope = $http.get('items.json').success(function(data){ | |
| $scope.items = data; | |
| }); | |
| }); |
This file contains hidden or 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(she.getFaceValue() >= 90 && | |
| she.getBreastSize().compare(new BreastSize("36D")) >= 0){ | |
| this.sleepWith(she); | |
| if(this.getHappiness() >= 60){ | |
| this.setGirlFriend(she); | |
| int prevHappiness = this.getHappiness(); | |
| // Wait for 2 months | |
| Thread.sleep(1000 * 3600 * 24 * 30 * 2); | |
| if(this.getHappiness() - prevHappiness >= 15){ |
This file contains hidden or 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
| void *(mouse_listener)(int, int); | |
| // Print coordinates if mouse is clicked | |
| void on_mouse_clicked(int x, int y){ | |
| printf("%d, %d", x, y); | |
| } | |
| // Tell other code what to do when mouse is clicked by registering a event listener | |
| void register_mouse_listener(void *(func_pointer)(int, int)){ | |
| mouse_listener = func_pointer; |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type Fetcher interface { | |
| // Fetch returns the body of URL and | |
| // a slice of URLs found on that page. | |
| Fetch(url string) (body string, urls []string, err error) |
This file contains hidden or 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
| package net.linni.webservice.controller.advice; | |
| import net.linni.webservice.exception.AbstractRestAPIException; | |
| import net.linni.webservice.exception.OperationFailureException; | |
| import net.linni.webservice.exception.UnauthorizedOperationException; | |
| import net.linni.webservice.model.Response; | |
| import net.linni.webservice.util.ResponseCode; | |
| import net.linni.webservice.util.ResponseFactory; | |
| import org.springframework.beans.TypeMismatchException; |
This file contains hidden or 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
| function embed_images($content){ | |
| $embed_images = preg_replace_callback('/https?:\/\/([A-z0-9]+[_\-]?[A-z0-9]+\.)*[A-z0-9]+\-?[A-z0-9]+\.[A-z]{2,}(\/.*)*\/?/i', "addimg",$content); | |
| return $embed_images; | |
| } | |
| function addimg($url){ | |
| global $post; | |
| $title = $post ->post_title; | |
| $imgurl = preg_replace('/((^http[s]{0,1}:)\/\/(.+).(gif|jpg|bmp|png))/i', '<img src="$1" alt="'.$title.'" /><pre>$1</pre>',$url[0]); | |
| if($imgurl !== $url[0]){ |
This file contains hidden or 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
| #Main>.box>.inner>table>tbody>tr, #Main>.box>.cell>table>tbody>tr{ | |
| position:relative; | |
| } | |
| #Main>.box>.inner>table>tbody>tr>td:nth-child(3), #Main>.box>.cell>table>tbody>tr>td:nth-child(3){ | |
| padding-right: 4em; | |
| } | |
| #Main>.box>.inner>table>tbody>tr>td:nth-child(4), #Main>.box>.cell>table>tbody>tr>td:nth-child(4){ | |
| position:absolute; | |
| top:0px; | |
| right:8px; |
This file contains hidden or 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
| window.addEventListener('load', function(){ | |
| var body = document.body, | |
| html = document.documentElement; | |
| var height = Math.max( body.scrollHeight, body.offsetHeight, | |
| html.clientHeight, html.scrollHeight, html.offsetHeight ); | |
| console.log(height/2 - window.innerHeight/2); | |
| window.scrollTo(0, height/2 - window.innerHeight/2); | |
| }); |
OlderNewer