Skip to content

Instantly share code, notes, and snippets.

Avatar

Salvodif

  • London
View GitHub Profile
@Salvodif
Salvodif / README.txt
Last active Aug 29, 2015
Yammer API Example
View README.txt
To get the APP-ID-CODE you have to create a new Yammer APP likes you can see in this pic: https://onedrive.live.com/redir?resid=326B1FC9A1CE351F!15015&authkey=!AMmmiBkza5_idPM&v=3&ithint=photo%2c.png
Also is IMPORTANT allows javascript calls from the source origin.
To do this you have to specify the source origin on the app info: https://onedrive.live.com/redir?resid=326B1FC9A1CE351F!15016&authkey=!AJ62DteVIedu_q0&v=3&ithint=photo%2c.png
@Salvodif
Salvodif / gist:c2c70b4189499c1c3230
Last active Aug 29, 2015
Singleton with Deffered to use a cookie or get the info from an endpoint
View gist:c2c70b4189499c1c3230
ClientInfo = ( function ( ) {
// Instance stores a reference to the Singleton
var instance;
var obj = { };
function init ( currentUserRegion ) {
var publicMethods = {
getRegionalCurrency : function ( ) {
@Salvodif
Salvodif / Get raw data from file or sharepoint then create a new file on sp library
Last active Aug 29, 2015
Get raw data from file or sharepoint then create a new file on sp library
View Get raw data from file or sharepoint then create a new file on sp library
function succeeded ( filename ) {
var statusId = SP.UI.Status.addStatus ( filename, "The file has been copied.", true );
SP.UI.Status.setStatusPriColor ( statusId, 'green' );
setTimeout ( function ( ) { SP.UI.Status.removeStatus ( statusId ); }, 4000 );
}
function failed ( filename ) {
var statusId = SP.UI.Status.addStatus ( filename, "The file hasn't been copied.", true );
SP.UI.Status.setStatusPriColor ( statusId, 'red' );
setTimeout ( function ( ) { SP.UI.Status.removeStatus ( statusId ); }, 4000 );
@Salvodif
Salvodif / gist:a308a683f18155770483
Created Jun 11, 2014
How to get and save a file from a list to another list in another site by REST API
View gist:a308a683f18155770483
function getParam ( name ) {
if ( name = ( new RegExp ( '[?&]' + encodeURIComponent ( name ) + '=([^&]*)' ) ).exec ( location.search ) )
return decodeURIComponent ( name [ 1 ] );
return "";
}
function copySelectedProposal ( selectedProposal, dstParam, succeededCallback, failedCallback ) {
@Salvodif
Salvodif / underscore string sprintf example
Last active Oct 30, 2017
underscore string sprintf example
View underscore string sprintf example
function copySelectedProposal ( selectedProposal, dstParam, succeededCallback, failedCallback ) {
if ( selectedProposal == null )
return;
var x = {
absUrl : _spPageContextInfo.siteAbsoluteUrl,
relUrl : _spPageContextInfo.webServerRelativeUrl,
dst : dstParam,
proposal : selectedProposal
@Salvodif
Salvodif / AzureAssetsConf
Last active Aug 29, 2015
Upload Assets to Azure's Blob Storage
View AzureAssetsConf
<?xml version="1.0" encoding="utf-8" ?>
<AzureConf>
<Blob>
<CssContainer Name="styles">
<FileFormat Ext="css" ContentType="text/css" />
</CssContainer>
<JsContainer Name="scripts">
<FileFormat Ext="js" ContentType="application/javascript" />
</JsContainer>
<ImgContainer Name="images">
View gist:7692798
var value = filter.split ( ':' );
var messageHtml = value [ 1 ] + '<span style="float: right" id="close_button_span"></span>';
Clarks.CC.Status.DisplayNotifyMessage ( "Filtered by: ", messageHtml, Clarks.CC.Status.Priority.Information );
var close_button = document.createElement ( 'a' );
var linkText = document.createTextNode ( "clear" );
close_button.appendChild ( linkText );
close_button.name = 'status_close_button';
View gist:6882615
<?xml version="1.0" encoding="utf-8" ?>
<AzureConf>
<Blob>
<Container FileExt="css" Name="css" />
<Container FileExt="js" Name="scripts" />
</Blob>
<AzureAccountInfo>
<Name>your blob account name</Name>
<Key>your blob account key</Key>
</AzureAccountInfo>
View gist:6882603
"$(MSBuildBinPath)\msbuild.exe" "$(ProjectDir)yui\MSBuild.xml"
powershell.exe -Command "& {Set-ExecutionPolicy Unrestricted}"
powershell.exe -NoLogo -NonInteractive -File "$(ProjectDir)UploadBundleOnAzure.ps1" -ProjectDir "$(ProjectDir)"
View gist:6882475
param([string]$ProjectDir)
# for some reason we have a " to remove at the end of string
$ProjectDir = $ProjectDir.Substring(0,$ProjectDir.Length-1)
$assetsDir = [string]::Format('{0}\{1}', $ProjectDir, 'Assets')
$myCss = Get-ChildItem "$assetsDir\Styles" -Filter "*.css" | % -process { $_.FullName }
$myJs = Get-ChildItem "$assetsDir\Scripts" -Filter "*.js" | % -process { $_.FullName }
You can’t perform that action at this time.