Skip to content

Instantly share code, notes, and snippets.

@dimatter
dimatter / a.js
Created February 4, 2019 22:07
mutation notifier
function MutationNotifier (
original,
event,
args,
deep,
path
) {
if (args == null) { args = {}; }
if (deep == null) { deep = false; }
000000000000e550 T _DSXAdaptData_GetUttCnt
000000000000db30 T _DSXAdaptData_GetUttInfo
000000000000e180 T _DSXAdapt_Cancel
0000000000011670 T _DSXAdapt_Collect
000000000000f630 T _DSXAdapt_DoNextAdapt
0000000000010320 T _DSXAdapt_End
000000000000eb40 T _DSXAdapt_GetParamValue
00000000000129f0 T _DSXAdapt_LoadModels
000000000000fe70 T _DSXAdapt_Persist
0000000000010990 T _DSXAdapt_Reprocess
@dimatter
dimatter / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created July 1, 2017 18:09 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@dimatter
dimatter / rc4.coffee
Created May 16, 2017 20:39 — forked from rhoot/rc4.coffee
Node.js RC4 encryption/decryption
###
Copyright (c) 2012 rhoot <https://github.com/rhoot>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
@dimatter
dimatter / gist:0206268704609de07119
Created November 3, 2015 09:01 — forked from howlingblast/gist:5814547
CoffeeScript: getter/setter example
Function::property = (prop, desc) ->
Object.defineProperty @prototype, prop, desc
class Person
constructor: (@firstName, @lastName) ->
@property 'fullName',
get: -> "#{@firstName} #{@lastName}"
set: (name) -> [@firstName, @lastName] = name.split ' '
p = new Person 'Leroy', 'Jenkins'
# jarvis bake pizza with bacon garlic and mozzarella
# jarvis make pizza with beef garlic mozzarella
# jarvis make pizza with foie gras and mayo with gorgonzola and some chili
# jarvis bake pizza
# jarvis make pizza
# jarvis cook up pizza
# jarvis pizza
# jarvis look up imdb the martian
# jarvis search google for the martian
<a target="_blank" href="EASLink=http://google.com">
<img width="930" height="180" src="_P_930x180_udsalg_fallback.jpg" border="0">
</a>
<script type="text/javascript">
var _window = window;
if (!(window.self === window.top)) {
_window = window.parent.window;
}
/* Set the wallpaper click url here: */
_window.adClickURL = "EASLink=https://www.facebook.com/#!/badehotellet?fref=ts";
<script>
if (window.location.host.indexOf('heltnormalt') > -1) {
_window.tv2 = {};
_window.popwin = function(){};
document_write('<script src="http://tv2.dk/profiles/tv2/modules/custom/t2zerowing/pkg/_core/common.js"></scr' + 'ipt>');
_window.jQuery('#topbanner').attr('style','background-color:none');
}
</script>
<script src="http://common.tv2.dk/js/t2ad_wallpaper.js"></script>
<script>
[pid 1485] 09:42:33.707733 gettimeofday({1348738953, 707800}, NULL) = 0 <0.000225>
[pid 1485] 09:42:33.709050 gettimeofday({1348738953, 709414}, NULL) = 0 <0.000282>
[pid 1485] 09:42:33.710163 gettimeofday({1348738953, 710290}, NULL) = 0 <0.000046>
[pid 1485] 09:42:33.710430 gettimeofday({1348738953, 710785}, NULL) = 0 <0.000343>
[pid 1485] 09:42:33.711216 gettimeofday({1348738953, 711349}, NULL) = 0 <0.000055>
[pid 1485] 09:42:33.711487 gettimeofday({1348738953, 711789}, NULL) = 0 <0.000576>
[pid 1485] 09:42:33.712369 gettimeofday({1348738953, 712497}, NULL) = 0 <0.000047>
[pid 1485] 09:42:33.712694 poll([{fd=13, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout) <0.000360>
[pid 1485] 09:42:33.713801 write(13, "[\0\0\0\3SELECT cid, data, created, "..., 95) = 95 <0.000297>
[pid 1485] 09:42:33.714911 read(13, "\1\0\0\1\5>\0\0\2\3def\16drupal_sporten\ncac"..., 16384) = 2486 <0.000055>
@dimatter
dimatter / gist:3076130
Created July 9, 2012 12:12
Render a mini panel, with a node argument given in an improper way.
/**
* Render a mini panel, with a node argument given in an improper way.
*/
function _render_mini_panel($mini_panel_id, $node = null)
{
$output = "";
$panel_mini = panels_mini_load($mini_panel_id);
if($panel_mini) {