Skip to content

Instantly share code, notes, and snippets.

View catrielmuller's full-sized avatar

Catriel Müller catrielmuller

View GitHub Profile
@catrielmuller
catrielmuller / gist:bfd0edc29b6b1b1f64bb
Created July 6, 2015 19:27
hook_webform_select_options_info
/**
* Private implementation of hook_webform_select_options_info().
*
* @see webform_webform_select_options_info()
*/
function general_webform_select_options_info()
{
$items = array();
$items['people'] = array(
@catrielmuller
catrielmuller / controllers.js
Created November 13, 2015 23:59
AngularJs Token Auth Demo - Metro 2015 Prog4
.controller('EntrarCtrl', function($rootScope, $scope, $stateParams, $http, $ionicPopup, $location ) {
$rootScope.userToken = '';
$scope.user={};
$scope.user.email='';
$scope.user.password ='';
$scope.doLogin = function() {
$http.post('http://api-prog4.herokuapp.com/login',$scope.user).then(function(resp) {
console.log(resp.data);
relieve = [[9, 2, 2, 2, 3, 5],
[9, 8, 3, 2, 4, 5],
[9, 7, 2, 2, 4, 3],
[9, 9, 2, 4, 4, 3],
[9, 2, 3, 4, 3, 5]];
function is_border(posx, posy, relieve){
var current = relieve[posy][posx];
var maxx = relieve[0].length;
var maxy = relieve.length;
function is_border(posx, posy, relieve){
var current = relieve[posy][posx];
var maxx = relieve[0].length;
var maxy = relieve.length;
/* TODO: I dont know but */
if(current == 9){
return 0;
}
/* TODO: I dont know but */
@catrielmuller
catrielmuller / app.json
Created September 8, 2016 14:27
PM2 Sails
{
"apps" : [{
"name": "sails",
"script": "app.js",
"watch": true,
"ignoreWatch" : [".tmp",".idea","views","node_modules"],
"node_args": ["--debug=5860"]
}]
}
@catrielmuller
catrielmuller / diff_dates_array.php
Created March 14, 2019 10:45
Get an Array of dates between 2 dates, one element per day
<?php
function diffDatesArray($from, $to, $formatInput, $formatOutput) {
$out = [];
$fromDate = DateTime::createFromFormat($formatInput, $from);
$toDate = DateTime::createFromFormat($formatInput, $to);
$interval = date_diff($fromDate, $toDate);
$daysInterval = intval($interval->format('%d'));
for ($i = 0; $i <= $daysInterval; $i++) {
$nextDay = clone $fromDate;
if($i >= 1){
catrielmuller@lolita  ~  LIBGL_DEBUG=verbose steam-runtime
Running Steam on arch rolling 64-bit
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
/home/catrielmuller/.local/share/Steam/ubuntu12_32/steam
Installing breakpad exception handler for appid(steam)/version(1579321278)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/catrielmuller/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/catrielmuller/.drirc: No such file or directory.
✘ catrielmuller@lolita  ~  LIBGL_DEBUG=verbose steam-native
Running Steam on arch rolling 64-bit
STEAM_RUNTIME is disabled by the user
/home/catrielmuller/.local/share/Steam/ubuntu12_32/steam
Installing breakpad exception handler for appid(steam)/version(1579321278)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/catrielmuller/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/catrielmuller/.drirc: No such file or directory.
libGL: pci id for fd 8: 1002:731f, driver radeonsi
catrielmuller@lolita  ~/Dev/OpenRGB   master  lsusb -vd 048D:
Bus 003 Device 003: ID 048d:8297 Integrated Technology Express, Inc. IT8297 RGB LED Controller
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
sudo usbhid-dump -d 048D
003:003:000:DESCRIPTOR 1596455092.605593
06 89 FF 09 10 A1 01 85 5A 09 01 15 00 26 FF 00
75 08 95 10 B1 00 C0 06 89 FF 09 CC A1 01 85 CC
09 01 15 00 26 FF 00 75 08 95 3F B1 00 C0
003:012:000:DESCRIPTOR 1596455092.607545
06 89 FF 09 10 A1 01 85 5A 09 01 15 00 26 FF 00
75 08 95 10 B1 00 C0 06 89 FF 09 CC A1 01 85 CC
09 01 15 00 26 FF 00 75 08 95 3F B1 00 C0