Skip to content

Instantly share code, notes, and snippets.

View IAMIronmanSam's full-sized avatar
🎯
Focusing

Tony Stark IAMIronmanSam

🎯
Focusing
View GitHub Profile
using (var client = new HttpClient())
{
//Enable signon and read users' profile
using (var request = new HttpRequestMessage(HttpMethod.Get, "https://graph.microsoft.com/beta/me"))
{
request.Headers.Add("Authorization", "Bearer " + token);
request.Headers.Add("Accept", "application/json;odata.metadata=minimal");
using (var response = client.SendAsync(request).Result)
{
@laurenorsini
laurenorsini / Index.html
Created April 4, 2014 14:26
Index.html
<html>
<head>
<link rel="stylesheet" href="scrabble.css" type="text/css" />
<link rel="stylesheet" href="css/ui-dark.css" type="text/css" />
<script type="text/javascript" src="js/base.js" ></script>
<script type="text/javascript" src="js/ui.js" ></script>
<script type="text/javascript" src="scrabble.js" ></script>
@vishaltelangre
vishaltelangre / jquery.tinysort.both-orders.js
Created May 12, 2013 04:54
PROTIP: Sort things in both orders vice-versa (asc/desc) w/ jQuery.TinySort plugin.
// custom function to sort by asc/desc
var sortOrders = {};
function sortResultsUsing(pattern, key, callback) {
sortOrders[key] = (sortOrders[key] == "asc") ? "desc" : "asc";
$('tbody.results>tr').tsort(pattern, { order: sortOrders[key] });
callback();
}
/* USAGE
@ChrisRisner
ChrisRisner / ServiceFilter.java
Last active December 16, 2015 09:58
Android auth demo
private class MyServiceFilter implements ServiceFilter {
@Override
public void handleRequest(final ServiceFilterRequest request, final NextServiceFilterCallback nextServiceFilterCallback,
final ServiceFilterResponseCallback responseCallback) {
nextServiceFilterCallback.onNext(request, new ServiceFilterResponseCallback() {
@Override
public void onResponse(ServiceFilterResponse response, Exception exception) {
if (exception != null) {
(function($){
$(document).ready(function(){
// Ensure that the SP.UserProfiles.js file is loaded before the custom code runs.
SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, 'SP.UserProfiles.js');
});
var userProfileProperties;
function loadUserData(){
@IAMIronmanSam
IAMIronmanSam / UrbanTraveller.sql
Created January 15, 2013 14:47
UrbanTraveller DB
CREATE TABLE UT_USERS (USERID INTEGER Not null primary key generated always as identity (start with 1, increment by 1),USERNAME VARCHAR(15) NOT NULL UNIQUE,PASSWORD VARCHAR(15) NOT NULL, LASTLOGIN TIMESTAMP)
using (ClientContext clientContext = new ClientContext("https://yoursite.sharepoint.com/"))
{
var passWord = new SecureString();
foreach (char c in "yourpassword".ToCharArray()) passWord.AppendChar(c);
clientContext.Credentials = new SharePointOnlineCredentials("[email protected]", passWord);
Web web = clientContext.Web;
@IAMIronmanSam
IAMIronmanSam / Login.visage
Created October 17, 2012 17:03
Login App
package visage.javafx.scene.effect;
import visage.animation.Interpolator;
import visage.animation.Timeline;
import visage.javafx.geometry.Rectangle2D;
import visage.javafx.stage.Stage;
import visage.javafx.scene.Group;
import visage.javafx.scene.Scene;
import visage.javafx.scene.effect.*;
import visage.javafx.scene.control.Button;
@shivkumarganesh
shivkumarganesh / cpp.properties
Created September 29, 2012 09:13
Visage Editor (Make Scite as the Default Visage Editor) - Just add this in the file cpp.properties {ie. Options->cpp.properties}
#For Visage Compilation/Build/Run
command.compile.*.visage=visagec -d . $(FileNameExt)
command.build.*.visage=visagec -d . *.visage
command.go.*.visage=visage -cp . $(FileName)
# jad = decompiled class files; pde = Processing.org sketch files
file.patterns.visage=*.visage
lexer.$(file.patterns.visage)=cpp
word.characters.$(file.patterns.visage)=$(word.chars.cxx)$-
@aaronroe
aaronroe / yammerPost.html
Created July 7, 2012 04:49
Doing a post on Yammer via Javascript API
<html>
<head>
<title>A Yammer App</title>
<script src="https://assets.yammer.com/platform/yam.js"></script>
<script>
yam.config({appId: "APP-ID"});
</script>
</head>
<body>
<button onclick='post()'>Post on Yammer!</button>