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
import aiohttp | |
import asyncio | |
import time | |
urls_i = [ | |
"http://google.com", | |
"https://stackoverflow.com" | |
] | |
urls = [] |
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
/* | |
Sick Yoon (shicky@gmail.com) (c) 2016 | |
Table Component for React | |
*/ | |
const React = require('react'); | |
const rowData = [ | |
{ | |
id: {type: 'text', data: '1243556'}, |
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
const Form = require('react-bootstrap/lib/Form'); | |
const FormGroup = require('react-bootstrap/lib/FormGroup'); | |
const FormControl = require('react-bootstrap/lib/FormControl'); | |
const Col = require('react-bootstrap/lib/Col'); | |
const ControlLabel = require('react-bootstrap/lib/ControlLabel'); | |
onChangeValue(evt, check=false) { | |
this.setState({[evt.target.id]: check?evt.target.checked:evt.target.value}); | |
}, |
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
const React = require('react'); | |
// sample callback | |
function onCheckboxClicked(e, id) { | |
console.log(e.target.id); | |
console.log(e.target.checked); | |
//store.dispatch(ReduxActions.updateSomething(something)); | |
} | |
const CheckboxInput = React.createClass({ |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
type Job struct { | |
url string |
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
from collections import defaultdict | |
d = defaultdict(lambda: defaultdict(lambda: -1)) | |
print(d[544][465]) # should be -1 |
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
public static void main(String[] args) { | |
// data type and max values | |
/* | |
width minimum maximum | |
byte: 8 bit -128 +127 | |
short: 16 bit -32 768 +32 767 | |
int: 32 bit -2 147 483 648 +2 147 483 647 | |
long: 64 bit -9 223 372 036 854 775 808 +9 223 372 036 854 775 807 | |
float: 32 bit 1.4E-45 3.402,823,5E+38 |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func main() { | |
// register method | |
tasks := make(map[string]interface{}) | |
tasks["add"] = add |
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
package gocelery | |
import ( | |
"reflect" | |
"strconv" | |
) | |
// GetRealValue returns real value of reflect.Value | |
func GetRealValue(val reflect.Value) interface{} { | |
switch val.Kind() { |
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
package main | |
import "github.com/miekg/dns" | |
// ResolveIP resolves IP address using provided DNS server | |
func ResolveIP(url, server string) (string, error) { | |
msg := new(dns.Msg) | |
msg.Id = dns.Id() | |
msg.RecursionDesired = true | |
msg.Question = make([]dns.Question, 1) |
OlderNewer