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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# Copy this file to ~/.config/fish/ | |
function fish_prompt | |
~/powerline-shell/powerline-shell.py $status --shell bare ^/dev/null | |
end |
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
@ECHO OFF | |
SETLOCAL | |
REM Speed up by checking for bin directory directly | |
IF NOT EXIST node_modules\.bin GOTO FINDBIN | |
SET BIN=.\node_modules\.bin | |
GOTO RUN | |
:FINDBIN | |
REM Find the current bin directory from npm, storing the result in 'BIN' |
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 office 365 session | |
$UserCredential = Get-Credential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
Import-PSSession $Session | |
#connect Azure AD | |
Connect-MsolService -Credential $UserCredential | |
#Random password generator | |
Function random-password ($length = 8) |
Save code.fish in ~/.config/fish/functions
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
/** | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { | |
return _.transform(object, function(result, value, key) { | |
if (!_.isEqual(value, base[key])) { |
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
/** | |
* Implementation of the Critical Path Method (CPM) with variation | |
* @see http://en.wikipedia.org/wiki/Critical_path_method | |
* | |
* Shows all the critical Paths, returns a subset of the graph | |
* containing the critical activities | |
*/ | |
/** | |
* Activity Class |
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
parseMustache = (str, obj) -> | |
str.replace /{{\s*([\w\.]+)\s*}}/g, (tag, match) -> | |
nodes = match.split(".") | |
current = obj | |
for node in nodes | |
try | |
current = current[node] | |
catch | |
return "" | |
current |
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
// Config file | |
import * as firebase from "firebase"; | |
const config = {...}; | |
export default !firebase.apps.length ? firebase.initializeApp(config) : firebase.app(); | |
// Other file | |
import firebase from '../firebase'; | |
... |
OlderNewer