Skip to content

Instantly share code, notes, and snippets.

@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
import { isEmpty } from 'lodash';
@Component({
// Metadata
})
export class AppComponent {
private isEmptyValue(value: any): boolean {
return isEmpty(value);
}
}
@marutiprasad
marutiprasad / akamaicachepurge.sh
Last active February 7, 2021 08:26
Akamai purge in the event of dispatcher / local cache purge
#!/bin/sh
# Before running this script, plese ensure the following tools are installed.
# 1. inotifywait (yum install inotify-tools)
# 2. akamai-purge (script https://github.com/akamai/cli-purge)
# 3. Keep the CCU API credentials in the .edgerc file in the user home dir.
ROOTDIR='/data/www/htdocs/publish/content/site1'
HOST_URL='https://www.myhost.com'
inotifywait -m -r -e delete $ROOTDIR |
while read dir ev file; do
@eeshansim
eeshansim / Workato_SFDC_Process_Builder.md
Last active July 19, 2018 07:20
Workato-Salesforce Integration. Learn how to connect a Process Builder in Salesforce.com to Workato Callable Recipes

Process Builder to Workato Recipes

Process Builder allows you to easily automate business processes without any code, using a graphical interface to build processes. However, it is limited to actions within Salesforce. To communicate with external web services, you will have to use more advanced features like an Apex code. This document shows you how to create an Apex class to communicate with a Workato Callable Recipe.

Apex code

We will not go into too much details about Apex. However, here are a few things you need to be aware of.

  • Uses HttpRequest class to communicate with Workato Callable recipes exposed as REST endpoints.
  • To expose an Apex class method to Process Builder, you must annotate each one with @InvocableMethod.
@pareddy113
pareddy113 / AWS Solutions Architect Associate
Last active April 1, 2024 08:03
AWS Solutions Architect Associate 2017- ACloud Guru course
----- Interested Reads------
+ Interesting Read (Serverless Architecture of Acloud guru)
https://read.acloud.guru/serverless-the-future-of-software-architecture-d4473ffed864
----- Getting Started-------
+ Requirements
+ AWS Free Tier Account
+ PC with putty and putty keygen/ Mac
+ Optional
+ IoS/ Android App $20
@andersonkxiass
andersonkxiass / DatabaseConfig.java
Last active October 16, 2018 20:13
Spring boot + postgres (Remotely)
@Configuration
@PropertySource({ "classpath:persistence.properties" })
public class DatabaseConfig {
@Bean
@Primary
@ConfigurationProperties(prefix = "spring.datasource")
public DataSource dataSource() {
return DataSourceBuilder.create().build();
}
}
@mrsarm
mrsarm / CompletableFutureGreeting.java
Created November 8, 2016 17:36
Java 8+ CompletableFuture example with error handling
CompletableFuture.supplyAsync(()-> {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
throw new RuntimeException("Error sleeping", e);
}
if (System.currentTimeMillis()%2==0) {
throw new RuntimeException("Even time..."); // 50% chance to fail
}
return "Hello World!";
//Resizer - Responsive Design Bookmarklet
javascript:(function(){document.body.appendChild(document.createElement('script')).src='http://codebomber.com/jquery/resizer/resizer.min.js';})();
//ish - yet another viewport resizer
bradfrostweb.com/demo/ish/?url=http%3A%2F%2Fbradfrostweb.com%2Fdemo%2Fish%2F
//Responsinator - Responsive Design Bookmarklet
javascript:location.href='http://www.responsinator.com/?url='+window.location.href
//RWD - Responsive Design Bookmarklet
@dmeents
dmeents / redux-form-tut.js
Created August 6, 2016 20:40
The source code for the redux form tutorial on davidmeents.com
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import * as actions from '../../actions';
const form = reduxForm({
form: 'ReduxFormTutorial',
validate
});
@jonashackt
jonashackt / bash
Last active December 1, 2021 01:45
Remote debugging Spring Boot
### java -jar
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=y -jar target/cxf-boot-simple-0.0.1-SNAPSHOT.jar
### Maven
Debug Spring Boot app with Maven:
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001"