Skip to content

Instantly share code, notes, and snippets.

public boolean checkRights(UserRights neededRight, Object manipulated){
final int RATING_CREATE_CATEGORY=1000;
final int RATING_DELETE_CARD=100;
switch(neededRight){
case CREATE_CATEGORY:{
if(rating>RATING_CREATE_CATEGORY){
return true;
}
return false;
}
@Security.Authenticated(ActionAuthenticator.class)
public Result upload() {
Logger.debug("upload!");
Http.MultipartFormData<File> body = request().body().asMultipartFormData();
Http.MultipartFormData.FilePart<File> picture = body.getFile("picture");
Logger.debug("picture="+picture);
if (picture != null) {
String fileName = picture.getFilename();
String contentType = picture.getContentType();
String fileType = determineFileType(fileName);
5 7
5
3
16
2
0
0 1 3
0 2 1
0 3 6
1 3 2
import os
import time
import winsound
import sys
class Watcher(object):
def __init__(self, filepath, search_keys):
self._cached_stamp = 0
self.filepath = filepath
Checking for Coordinates: {"type":"Point","coordinates":[9.9823,48.4391]}, @ 2017-06-29T12:47:00+02:00
{
"values": {
"air_temperature": [
{
"temperature2m_degC": " 18.1",
"relativeHumidity_percent": " 67.0",
"stationId": 15444,
"date": "2017-06-29T11:00:00+00:00",
"description": {
@FWidm
FWidm / dwd.json
Created August 21, 2017 11:19
Lib Outputs
{
"values": {
"air_temperature": [
{
"temperature2m_degC": "15.0",
"relativeHumidity_percent": "70.0",
"stationId": 2886,
"date": "2016-06-19T10:00:00+00:00",
"description": {
"qualityBit": "QN_9: Quality bit refer to ftp:\/\/ftp-cdc.dwd.de\/pub\/CDC\/observations_germany\/climate\/hourly\/air_temperature\/historical\/BESCHREIBUNG_test_obsgermany_climate_hourly_tu_historical_de.pdf",
@FWidm
FWidm / bowers_wilkins_mm1_fixes.md
Last active November 3, 2018 14:40
Fix MM-1 Bower&Wilkins speakers

Windows 8+: Install drivers and updatertool

  1. Obtain driver from http://www.bwgroupsupport.com/download/software
  2. Install drivers & Updater-Software
  • If the driver cannot be installed (default for win8, win10) enter testmode:
    1. Start CMD/Powershell as admin
    2. bcdedit /set testsigning on
    3. Reboot
    4. Reinstall the software - driver should install fine
    5. Start CMD/Powershell as admin and disable testing mode: bcdedit /set testsigning off
  1. Reboot
@FWidm
FWidm / 0_FindDependencies.log
Last active November 25, 2017 16:39
A small CLI tool that finds all `use`d containers for a container. In addition it also detects active `Apiato::call` (only spaces or tabs in front of a call)
$ php artisan apiato:container-dependencies app/Containers/GeoLocation/
Searching for dependencies in container: app/Containers/GeoLocation/
Remove own container from listings? (y/n):
> n
Found dependencies:
[imports]:
[Authentication]:
[0]: app/Containers/GeoLocation/Actions/CreateGeoRequestAction.php
<?xml version="1.0" encoding="UTF-8"?>
<PathOfBuilding>
<Build level="93" targetVersion="3_0" className="Scion" ascendClassName="Ascendant" />
<Skills>
<Skill slot="Helmet" enabled="true">
<Gem level="20" quality="0" enabled="true" nameSpec="Increased Duration" />
<Gem level="20" quality="0" enabled="true" nameSpec="Cast when Damage Taken" />
<Gem level="20" quality="0" enabled="true" nameSpec="Immortal Call" />
<Gem level="1" quality="20" enabled="true" nameSpec="Flame Dash" />
</Skill>
Newest on top:
\Device\Video3
Graphics Exception on BE 30: CRD_LONG_WAIT_ON_FREE_TAGS
\Device\Video3
Graphics Exception on BE 30: CRD_CACHE_HIT_FROM_OTHER_GPC
\Device\Video3
Graphics Exception on BE 30: Graphics is hung, FATAL!!
\Device\Video3
Graphics Exception on BE 30: CRD_DEAD_TAGS