Skip to content

Instantly share code, notes, and snippets.

View waspinator's full-sized avatar
🎯
Focusing

waspinator waspinator

🎯
Focusing
View GitHub Profile
@waspinator
waspinator / gist:1168804
Created August 24, 2011 18:33
array intersection
$array_a = array(0 =>
array('Document' =>
array('id' => 1)),
array('Document' =>
array('id' => 2)),
array('Document' =>
array('id' => 3)),
);
$array_a = array(0 =>
array('Document' =>
array('id' => 1)),
array('Document' =>
array('id' => 2)),
array('Document' =>
array('id' => 3)),
);
dataset_tool
@waspinator
waspinator / designer.html
Last active August 29, 2015 14:15
designer
<link href="../topeka-elements/topeka-resources.html" rel="import">
<link href="../topeka-elements/topeka-profile.html" rel="import">
<polymer-element name="my-element">
<template>
<style>
#design_host {
position: absolute;
width: 100%;
// UsersController.php
public function edit($id = null)
{
$user = $this->Users->get($id);
if ($this->request->is(['patch', 'post', 'put'])) {
$user = $this->Users->patchEntity($user, $this->request->data);
if ($this->Users->save($user)) {
$this->Flash->success('The user has been saved.');
public function password($id = null)
{
$user = $this->Users->get($id);
if ($this->request->is(['patch', 'post', 'put'])) {
$user = $this->Users->patchEntity($user, $this->request->data);
if ($this->request->is(['ajax'])) {
if ($this->Users->save($user)) {
} else {
@waspinator
waspinator / pyqt_thread.py
Created November 30, 2016 17:06
pyqt thread example
import random
import sys
from PyQt5 import QtWidgets, uic, QtCore, QtGui
class Worker(QtCore.QThread):
data = QtCore.pyqtSignal(dict)
def __init__(self, parent=None):
super(Worker, self).__init__(parent)
@waspinator
waspinator / API.md
Created May 9, 2017 13:22 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@waspinator
waspinator / test.bib
Last active July 4, 2018 23:17
broken BibLaTeX encoding
@article{test_2018,
title = {Test—with a dash},
volume = {62},
issn = {1231-1231},
url = {http://ww.google.com},
doi = {11.1111/1111-1111(11)11111-P},
abstract = {Test},
pages = {11-111},
number = {111},
journaltitle = {Test},
@waspinator
waspinator / install_dhcp.md
Last active October 2, 2018 14:41
dhcp server setup ubuntu 16.04

Install the dhcp server

sudo apt-get install isc-dhcp-server

Edit dhcp server settings

Configuration files:

  • /etc/default/isc-dhcp-server
  • /etc/dhcp/dhcpd.conf