Skip to content

Instantly share code, notes, and snippets.

View khaosans's full-sized avatar
🏠
Studying

SourC khaosans

🏠
Studying
View GitHub Profile
import json
from django.contrib.auth import authenticate, login as _login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import login as auth_login
from django.db import transaction
from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.decorators import method_decorator
import json
from django.contrib.auth import authenticate, login as _login
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import login as auth_login
from django.db import transaction
from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.decorators import method_decorator
@khaosans
khaosans / gist:5f85b2f985ec6ffe873d
Last active August 29, 2015 14:26
Mobile Base template
/** In this file, we create a React component which incorporates components provided by material-ui */
let React = require('react');
let mui = require('material-ui');
let Router = require('react-router');
let FullWidthSection = require('./full-width-section.jsx');
let AppCanvas = mui.AppCanvas;
let TextField = mui.TextField;
let RaisedButton = mui.RaisedButton;
let Styles = mui.Styles;
log "Hello, world!";
//declare the stuff
var s: string;
var n: number;
var b: boolean;
//set the stuff here
s = "helo";
n = 10;
@khaosans
khaosans / gist:60deb5f8020a18183a91
Last active September 17, 2015 20:51
Rest Call Item Move Demo
item 640685
//original project
{
"project": 49,
"fields": {
"name": "Component1"
},
"location": {
@khaosans
khaosans / gist:7a42f1a4c1b5c274ccc1
Created September 21, 2015 16:47
documentService impl
/*
* Copyright (c) 2005-2006 Jama Software, Inc. 600 NW 14th Avenue, Portland, Oregon 97209 U.S.A. All rights reserved.
*
* This software is the confidential and proprietary information of Jama Software, Inc. ("Confidential Information").
* You shall not disclose such Confidential Information and shall use it only in accordance with the terms of the
* license agreement you entered into with Jama Software.
*/
package com.jamasoftware.contour.service.impl;
DocumentServiceImpl.java
DocumentServiceImpl.java
package com.concretepage.util.concurrent;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class CompletableFutureOneExample {
public static void main(String[] args) throws InterruptedException {
List<Integer> list = Arrays.asList(10,20,30,40);
list.stream().map(data->CompletableFuture.supplyAsync(()->getNumber(data))).
map(compFuture->compFuture.thenApply(n->n*n)).map(t->t.join())
.forEach(s->System.out.println(s));