Skip to content

Instantly share code, notes, and snippets.

View borsi's full-sized avatar

Zoltan Borsos borsi

View GitHub Profile
@borsi
borsi / slower.js
Created January 21, 2021 11:01
S L O W E R I Z E text bookmarklet - select text and click the bookmarklet
/*
Select a text and click your bookmarklet - now you can paste the selected text s l o w e r.
H a v e F u n !
*/
javascript: (function () {
function copyTextToClipboard(text) { var textArea = document.createElement("textarea"); textArea.style.position = 'fixed'; textArea.style.top = 0; textArea.style.left = 0; textArea.style.width = '2em'; textArea.style.height = '2em'; textArea.style.padding = 0; textArea.style.border = 'none'; textArea.style.outline = 'none'; textArea.style.boxShadow = 'none'; textArea.style.background = 'transparent'; textArea.value = text; document.body.appendChild(textArea); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; console.log('Copying text command was ' + msg); } catch (err) { console.log('Oops, unable to copy'); } document.body.removeChild(textArea); };
var a = "";
if (window.getSelection) {
t = window.getSelection().toString();
[...t].forEach(c => a += (c + " "));

Keybase proof

I hereby claim:

  • I am borsi on github.
  • I am borsi (https://keybase.io/borsi) on keybase.
  • I have a public key ASDhPbMLwa2rY3XoGcHlb9ZOMtMasn18hpRqEvNZD8CfRQo

To claim this, I am signing this object:

@borsi
borsi / sn-client-js-render-article-list-example.js
Created July 5, 2017 10:05
Sensenet client-js example #3
import * as React from 'react'
import * as ReactDOM from 'react-dom'
ReactDOM.render(
<ArticleList content={articles} />,
document.getElementById('root')
);
class ArticleList extends React.Component<{ content }, {}> {
const articles = this.props.content;
render(){
return (
@borsi
borsi / sn-client-js-fetch-collection.js
Created July 5, 2017 10:04
Sensenet client js example #2
import * as SN from 'sn-client-js';
let collection = new SN.Collection([], repository.Content);
var options = new SN.ODataApi.ODataParams({
select: ["Id", "DisplayName", "BrowseUrl", "Author", "ModificationDate", "Lead"],
orderby: 'ModificationDate',
metadata: 'no' });
let fetchContent = collection.Read('/NewsDemo/External', options);
fetchContent
.map(response => response.d.results)
.subscribe({
import { Repository, Config } from 'sn-client-js';
let repository = new Repository.SnRepository({
RepositoryUrl: 'https://my-sensenet-site.com'
});
@borsi
borsi / sn-template-example.xml
Created July 5, 2017 09:58
Sensenet template example
<div class="sn-article-list">
<%foreach (var content in this.Model.Items)
{ %>
<div class="sn-article-list-item">
<h2 class="sn-article-title">
<a href="<%=Actions.BrowseUrl(content)%>">
<%= content.DisplayName %>
</a>
</h2>
<small class="sn-article-info">
@borsi
borsi / sensenet_ecm_CLA.md
Created April 28, 2017 13:55
Sensenet ECM Contributor Licence Agreement

sensenet ECM Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Contribution - any type of work that is submitted to the repository, including any modifications or additions to existing work.
  • Organization - Sense/Net Inc. Organization (https://github.com/SenseNet)
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with the copyright owner, contributors or maintainers.
@borsi
borsi / semmi.js
Created December 11, 2012 13:40
valami21
document.write('<link rel="stylesheet" href="https://gist.github.com/stylesheets/gist/embed.css"/>')
document.write('<div id=\"gist-3827596\" class=\"gist\">\n \n\n <div class=\"gist-file\">\n <div class=\"gist-data gist-syntax\">\n <div class=\"gist-highlight\"><pre><div class=\'line\' id=\'LC1\'><span class=\"c1\">// if both logged in and not logged in users can send this AJAX request,<\/span><\/div><div class=\'line\' id=\'LC2\'><span class=\"c1\">// add both of these actions, otherwise add only the appropriate one<\/span><\/div><div class=\'line\' id=\'LC3\'><span class=\"nx\">add_action<\/span><span class=\"p\">(<\/span> <span class=\"s1\">&#39;wp_ajax_nopriv_myajax-submit&#39;<\/span><span class=\"p\">,<\/span> <span class=\"s1\">&#39;myajax_submit&#39;<\/span> <span class=\"p\">);<\/span><\/div><div class=\'line\' id=\'LC4\'><span class=\"nx\">add_action<\/span><span class=\"p\">(<\/span> <span class=\"s1\">&#39;wp_ajax_myajax-submit&#39;<\/span><span class=\"p\">,<\/sp
@borsi
borsi / valami
Created December 11, 2012 13:39
valami21
document.write('<link rel="stylesheet" href="https://gist.github.com/stylesheets/gist/embed.css"/>')
document.write('<div id=\"gist-3827596\" class=\"gist\">\n \n\n <div class=\"gist-file\">\n <div class=\"gist-data gist-syntax\">\n <div class=\"gist-highlight\"><pre><div class=\'line\' id=\'LC1\'><span class=\"c1\">// if both logged in and not logged in users can send this AJAX request,<\/span><\/div><div class=\'line\' id=\'LC2\'><span class=\"c1\">// add both of these actions, otherwise add only the appropriate one<\/span><\/div><div class=\'line\' id=\'LC3\'><span class=\"nx\">add_action<\/span><span class=\"p\">(<\/span> <span class=\"s1\">&#39;wp_ajax_nopriv_myajax-submit&#39;<\/span><span class=\"p\">,<\/span> <span class=\"s1\">&#39;myajax_submit&#39;<\/span> <span class=\"p\">);<\/span><\/div><div class=\'line\' id=\'LC4\'><span class=\"nx\">add_action<\/span><span class=\"p\">(<\/span> <span class=\"s1\">&#39;wp_ajax_myajax-submit&#39;<\/span><span class=\"p\">,<\/sp