Skip to content

Instantly share code, notes, and snippets.

@lordnox
lordnox / chat.tsx
Created March 7, 2023 19:46
SSE-cleanup not working in solid start
import { createEffect, createSignal, onCleanup } from 'solid-js'
import server$, { eventStream } from 'solid-start/server'
function createEventStream({ url }: { url: string }, onMessage: (ev: MessageEvent) => void) {
createEffect(() => {
const eventSource = new EventSource(url)
eventSource.addEventListener('chat', (event) => {
onMessage(event)
})
@lordnox
lordnox / rename-all-file-by-date.fish
Created September 3, 2020 20:43
Renames all files from german data DD.MM.YYYY.pdf to YYYY-MM-DD.pdf
for f in *; set n (echo $f | sed 's/\(.*\)\.\(.*\)\.\(.*\)\.pdf/\3-\2-\1.pdf/'); mv $f $n; end
@lordnox
lordnox / whatsapp_phone_enumerator_floated_div.js
Created May 16, 2017 17:39
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses (floated div)
/*
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses
Floated div edition
01-05-2017
(c) 2017 - Loran Kloeze - [email protected]
This script creates a UI on top of the WhatsApp Web interface. It enumerates certain kinds
of information from a range of phonenumbers. It doesn't matter if these numbers are part
of your contact list. At the end a table is displayed containing phonenumbers, profile pics,
about texts and online statuses. The online statuses are being updated every
module.run(function($rootScope) {
$rootScope.$on($stateChangeSuccess, function($event, toState, toParams, fromState, fromParams) {
if(toState.title)
$rootScope.title = toState.title
})
})
module.config(function($stateProvider) {
$stateProvider.state('myState', {
data : {
{
request: function(url, method, data, headers) {
var request;
if (method == null) {
method = "GET";
}
request = angular.isObject(url) ? angular.copy(url) : {
url: url
};
request.method = request.method || method || "GET";
/**
* Workaround to make defining and retrieving angular modules easier and more intuitive.
*/
(function(angular) {
var origMethod = angular.module;
var alreadyRegistered = {};
/**
var Twit = require("twit");
var config = require('./oauthconfig');
console.log("config:");
console.log(config);
var T = new Twit({
consumer_key: config.consumer_key,
consumer_secret: config.consumer_secret,
access_token: config.access_token,
@lordnox
lordnox / js2xml.coffee
Created January 5, 2012 17:04
Obj2XML Parser Coffeescript
###
Object 2 XML Parser
@author Tobias Kopelke <[email protected]>
based on jsontoxml from Ryan Day @ https://github.com/soldair/node-jsontoxml
Example of 'special' object properties
node =
name: 'node-name'
attributes: 'node-attribs'
@lordnox
lordnox / app.js
Created May 27, 2011 09:59
Express / Socket.IO sessions issue
// [~/Documents/code/node/myapp](master)$ ./bin/node -v
// => v0.2.1
// [~/Documents/code/node/myapp](master)$ ./bin/express -v
// => 1.0.0rc4
/**
* Module dependencies.
*/
require.paths.unshift(__dirname + '/lib/node');