This file contains hidden or 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 strict'; | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var browserSync = require('browser-sync').create(); | |
var reload = browserSync.reload; | |
var DIST = 'dist'; |
This file contains hidden or 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
var getMdmCodes = function() { | |
var requests = [ | |
service.getProductGroupCodes | |
, service.getProductTypeCodes | |
, service.getStatusCodes | |
, service.getCountryCodes | |
, _.partial(service.getParties, 'shipper') | |
, _.partial(service.getParties, 'consignee') | |
, _.partial(service.getTariffPointsForUser, {tariffPointType: 'origin'}) | |
, _.partial(service.getTariffPointsForUser, {tariffPointType: 'destination'}) |
This file contains hidden or 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
int foo = 0; | |
int bar = foo++; | |
print(foo); // <= ? | |
print(bar); // <= ? | |
// 5,000,000 ints of 10 | |
std::vector<int> stuff(5000000, 10); | |
// do you know what's in the var 'it'? Is it safe to copy lots and lots? | |
for (std::vector<int>::iterator it = stuff.begin(); it != stuff.end(); it++) { |
This file contains hidden or 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 move = (obj) => { | |
if(obj.moving) { | |
const newLocation = new Vector3( | |
obj.transform.x + obj.speed.x | |
, obj.transform.y + obj.speed.y | |
, obj.transform.z + obj.speed.z | |
); | |
var newTransform = new Transform(obj.transform, {location: newLocation}) * Time.delta}); | |
return new SceneObj(obj, {transform: newTransform}); | |
} |
This file contains hidden or 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
Maybe<Email, Exception> UpdateEmail(Maybe<Email, Exception> m) { | |
m = ValidateEmail(m); | |
m = UpdateUserEmail(m); | |
m = SendVerificationEmail(m); | |
return m; | |
} |
This file contains hidden or 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
makeGuid = () -> | |
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) -> | |
r = Math.random() * 16 | 0 | |
if c == 'x' | |
v = r | |
else | |
v = r = (r&0x3|0x8) | |
return v.toString(16) | |
) |
This file contains hidden or 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
# standard ls colors | |
alias ls="ls -G" | |
# grep highlights your search matches | |
alias grep="grep --color=auto" | |
# makes the prompt show exit code, sends an alert (beep), shows the time the prmopt was shown, and the current path. $ is on the next line. | |
# also colored pink to make easier to spot | |
export EXIT_STATUS_VAR='$?' | |
export PS1="\[\e[35m\]\a$(echo $EXIT_STATUS_VAR):\j*\@ \u@\h \w\n\$ \[\e[0m\]" | |
export PS2="" |
This file contains hidden or 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
for (int i = 0; i < 10; i++) { | |
UniThread.EnqueueAsyncUnityTask( | |
gameObject.name + i, // name the job after my game object | |
() => { | |
var result = EncryptAndSave( texBytes, i ); | |
//var result = BuildLargeMesh(); | |
return result; // if your task doesn't have anything to return, just return null | |
}, | |
(result) => { Debug.Log ("///////// Here"); Display( result as byte[] ); }, // executes on the main thread, can touch Unity. This argument is optional. |
This file contains hidden or 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
if(true) { | |
var bar = "bazz"; | |
DoSomethingWithBar(bar); | |
} | |
var bar = "qux"; // oh noes! You already declared bar even though you can't get to it and it's out of scope. |
This file contains hidden or 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
#!/bin/sh | |
# Shell script to install your public key on a remote machine | |
# Takes the remote machine name as an argument. | |
# Obviously, the remote machine must accept password authentication, | |
# or one of the other keys in your ssh-agent, for this to work. | |
ID_FILE="${HOME}/.ssh/id_rsa.pub" | |
if [ "-i" = "$1" ]; then |