Skip to content

Instantly share code, notes, and snippets.

View lukin0110's full-sized avatar
💭
Busy setting my status

Maarten Huijsmans lukin0110

💭
Busy setting my status
View GitHub Profile
{
"Records": [
{
"EventSource": "aws:sns",
"EventVersion": "1.0",
"EventSubscriptionArn": "arn:aws:sns:eu-west-1:123415737820:download:41cbc65b-a00b-4289-9916-c78a4149dd1f",
"Sns": {
"Type": "Notification",
"MessageId": "0e5cc6b5-e8e5-527c-a8bb-89a5bace935f",
"TopicArn": "arn:aws:sns:eu-west-1:123415737820:download",
// variant 1
var self = this;
this.nums.forEach(function (v) {
if (v % 5 === 0)
self.fives.push(v);
});
// variant 2 (since ECMAScript 5.1 only)
this.nums.forEach(function (v) {
if (v % 5 === 0)
this.nums.forEach((v) => {
if (v % 5 === 0)
this.fives.push(v);
});
odds = evens.map(v => v + 1);
pairs = evens.map(v => ({ even: v, odd: v + 1 }));
nums = evens.map((v, i) => v + i);
odds = evens.map(function (v) { return v + 1; });
pairs = evens.map(function (v) { return { even: v, odd: v + 1 }; });
nums = evens.map(function (v, i) { return v + i; });
@lukin0110
lukin0110 / GulpReactBrowserifyBabelify.md
Last active October 26, 2020 00:36
Gulp + browserify + babelify + react

Use React with Gulp, Browserify and Babelify. This allows you to use React in jsx & node.js style. It let's you use require('module') in your JavaScript. Babelify will transform the jsx code to JavaScript code.

Development

gulp build-react

This will generate a main.min.js file in the build directory with sourcemaps.

Production

@lukin0110
lukin0110 / mac.sh
Created September 1, 2015 12:52
Get mac address in ubuntu
#!/bin/bash
ifconfig -a eth0 | grep HWaddr | awk -F 'HWaddr ' '{print $2}'
@lukin0110
lukin0110 / gulpfile-git-version.js
Created August 26, 2015 15:06
Gulp git version, fetches the latest git commit hash. Can be used as version for your application. Inject/replace it in your html
'use strict';
var gulp = require('gulp');
var spawn = require('child_process').spawn;
var GIT_VERSION = "na";
gulp.task('version', function(){
//git --git-dir=.git log --pretty='%ct %h' -1
//git --git-dir=.git log --pretty='%h' -1
<Response>
<Message>Hello, Mobile Monkey</Message>
</Response>
git checkout better_branch
git merge --strategy=ours master # keep the content of this branch, but record a merge
git checkout master
git merge better_branch # fast-forward master up to the merge