Skip to content

Instantly share code, notes, and snippets.

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@Zren
Zren / gist:beaafd64f395e23f4604
Last active April 29, 2017 18:26
Ionic Scroll onMouseWheel
app.directive 'mouseWheelScroll', ($timeout) ->
return {
restrict: 'A'
# require: '^$ionicScroll'
link: ($scope, $element, $attrs) ->
scrollCtrl = $element.controller('$ionicScroll')
console.log scrollCtrl
unless scrollCtrl
return console.error('mouseWheelScroll must be attached to a $ionicScroll controller.')
@Entity
public class Parent implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<Child> children = new HashSet<>();
...
@stefan-huettemann
stefan-huettemann / RestTemplate-Multipart.java
Last active February 6, 2024 21:19
Multipart Request using spring RestTemplate
protected ResponseEntity<Resource<List<Attachment>>> patchMultipartApiV1_Treatments_TID(final String aTID,
final Treatment aTreatment,
final boolean keepLock,
final MultipartFile... aMultipartFiles) throws IOException {
final MultiValueMap<String, Object> theMultipartRequest = new LinkedMultiValueMap<>();
// creating an HttpEntity for the JSON part:
final HttpHeaders theJsonHeader = new HttpHeaders();
theJsonHeader.setContentType(MediaType.APPLICATION_JSON);
@robsonsobral
robsonsobral / _headers
Last active August 10, 2023 21:08
Netlify headers
/*
# Only connect to this site and subdomains via HTTPS for the next one year
Strict-Transport-Security: max-age=31536000; includeSubDomains
# Block site from being framed with X-Frame-Options and CSP
Content-Security-Policy: frame-ancestors 'self'
# X-Frame-Options tells the browser whether you want to allow your site to be framed or not. By preventing a browser from framing your site you can defend against attacks like clickjacking.
X-Frame-Options: SAMEORIGIN