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
private <T> void injectConfiguration(T objectToConfigure) { | |
injectFields(objectToConfigure); | |
injectMethods(objectToConfigure); | |
boolean found = false; | |
for (WeakReference<Object> configuredObject : configuredObjects) { | |
if (configuredObject.get() == objectToConfigure) { | |
found = true; | |
break; | |
} | |
} |
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
window.onerror = function(errorMsg, url, lineNumber) { | |
alert('noobface, plz'); | |
}; |
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
/** | |
* | |
* Også kan jeg kommentere her. | |
* | |
* Simple server-side request filter that implements CSRF protection as per the | |
* <a href="http://www.nsa.gov/ia/_files/support/guidelines_implementation_rest.pdf">Guidelines for Implementation of REST</a> | |
* by NSA (section IV.F) and | |
* section 4.3 of <a href="http://seclab.stanford.edu/websec/csrf/csrf.pdf">this paper</a>. | |
* If you add it to the request filters of your application, it will check for X-Requested-By header in each | |
* request except for those that don't change state (GET, OPTIONS, HEAD). If the header is not found, |
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
public class LedConfigTester { | |
public static void runEternally() throws InterruptedException { | |
GpioController gpioController = GpioFactory.getInstance(); | |
List<Pin> pins = asList(RaspiPin.GPIO_00, RaspiPin.GPIO_01, RaspiPin.GPIO_02, RaspiPin.GPIO_03, RaspiPin.GPIO_04); | |
List<GpioPinDigitalOutput> digitalPins = new ArrayList<GpioPinDigitalOutput>(); | |
for (Pin pin : pins) { | |
GpioPinDigitalOutput gpioPinDigitalOutput = gpioController.provisionDigitalOutputPin(pin, PinState.LOW); | |
digitalPins.add(gpioPinDigitalOutput); |
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
package no.posten.dpost.signering; | |
import org.springframework.xml.transform.StringSource; | |
import javax.xml.bind.JAXBContext; | |
import javax.xml.bind.Marshaller; | |
import javax.xml.bind.Unmarshaller; | |
import javax.xml.bind.annotation.XmlRootElement; | |
import javax.xml.stream.XMLInputFactory; | |
import javax.xml.stream.XMLStreamReader; |