Skip to content

Instantly share code, notes, and snippets.

View vphantom's full-sized avatar

Stéphane Lavergne vphantom

View GitHub Profile
@panzi
panzi / no_blocking_overlay.js
Last active November 28, 2021 03:00
A bookmarklet that removes these nasty overlays from websites that would work perfectly fine without a login, but still want you to create one. Create a new bookmark and paste the script source as the URL. (Use "Raw" to see only the script source for easy copy-paste.) When on a page with a blocking overlay click the bookmark.
javascript:(()=>{var d=document.documentElement,b=document.body,es=b.querySelectorAll("*"),m=20;for(var i=0;i<es.length;++i){var e=es[i];var s=getComputedStyle(e);if(s.position!=='static'&&s.position!=='relative'){var r=e.getBoundingClientRect();if(r.x<=m&&r.y<=m&&r.right>=window.innerWidth - m&&r.bottom>=window.innerHeight - m){e.remove();}}}var s='\n/**/;position:static!important;overflow:auto!important;width:auto!important;height:auto!important;';d.setAttribute('style',(d.getAttribute('style')||'')+ s);b.setAttribute('style',(b.getAttribute('style')||'')+ s);})();void(0)
@panzi
panzi / deleteElement.js
Last active November 27, 2021 08:45
Delete an element by clicking it. Save this script as the URL of a bookmark, click the bookmark, and then click the element you want to delete. (Click Raw to get to a page that only shows the script source for easier copy-paste.)
javascript:(function(){var cursor=document.body.style.cursor;var overlay=document.createElement('div');var iframeCatch=document.createElement('div');var style='border:1px solid #3280FF;background-color:rgba(50,128,255,0.5);position:absolute;z-index:2147483647;display:block;box-sizing:border-box;left:0;top:0;width:0;height:0;margin:0;padding:0;';var ev='pointer-events:none;';var tr='transition:width 60ms,height 60ms,left 60ms,top 60ms;';var br='border-radius:0;';style +=ev+'-webkit-'+ev+'-moz-'+ev;style +=tr+'-webkit-'+tr+'-moz-'+tr;style +=br+'-webkit-'+br+'-moz-'+br;overlay.setAttribute('style',style);document.body.appendChild(overlay);style='border:none;position:absolute;z-index:2147483647;display:none;box-sizing:border-box;left:0;top:0;width:0;height:0;margin:0;padding:0;';style +=br+'-webkit-'+br+'-moz-'+br;iframeCatch.setAttribute('style',style);iframeCatch.addEventListener('mouseout',function(event){this.style.display='none';},false);document.body.appendChild(iframeCatch);document.body.style.cursor="cro
@nicelife90
nicelife90 / example.php
Created October 5, 2017 20:09
Acomba ODBC - PHP Query
<?php
$dbq = "Driver={Acomba ODBC Driver};AcombaExe=C:\Users\ylafontaine\Desktop\Acomba;Dbq=\\\AD-FS01\acomba\F1000.DTA\Addison";
$conn = odbc_connect($dbq, "USER", "PASS");
if (!$conn) {
echo "Erreur au niveau de la connexion !!<br>";
}
else {
odbc_exec($conn, "BEGIN_TRANSACTION_IN");
$req = "SELECT * FROM Customer";
@ethack
ethack / TypeClipboard.md
Last active April 16, 2024 09:14
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

@jj-issuu
jj-issuu / eval.ml
Last active June 14, 2023 21:20
Benchmark interpreters written in OCaml
(*
* opam install bench
* ocamlfind ocamlopt -package unix,bench -linkpkg eval.ml && ./a.out
*)
type binop = Add | Sub | Mul | Div
type expr =
| Const of int
| VarX
@addyosmani
addyosmani / package.json
Last active January 18, 2024 21:31
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@fbriere
fbriere / mailbinpurge.py
Last active January 22, 2018 13:23
Remove all binary attachments from email messages
#!/usr/bin/python
# vim: set fileencoding=utf-8:
# Remove all binary attachments from email messages
#
# This is a standard UNIX filter; it reads a message or mailbox from standard
# input, and outputs it again on standard output, with all binary attachments
# removed (with message/external-body).
#
# Written by Frédéric Brière <fbriere@fbriere.net>. Copy at will.
@maxgalbu
maxgalbu / Switch_Node.php
Last active December 31, 2019 16:03
Switch tag for Twig, updated from https://github.com/fabpot/Twig/pull/185 to work with Twig >= 1.12
<?php
//To be added under Twig/Node/Switch.php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
* (c) 2009 Armin Ronacher
*
@askehansen
askehansen / gist:6809825
Created October 3, 2013 13:28
Parsley config for twitter bootstrap 3.x
$.fn.parsley.defaults = {
// basic data-api overridable properties here..
inputs: 'input, textarea, select' // Default supported inputs.
, excluded: 'input[type=hidden], :disabled' // Do not validate input[type=hidden] & :disabled.
, trigger: false // $.Event() that will trigger validation. eg: keyup, change..
, animate: true // fade in / fade out error messages
, animateDuration: 300 // fadein/fadout ms time
, focus: 'first' // 'fist'|'last'|'none' which error field would have focus first on form validation
, validationMinlength: 3 // If trigger validation specified, only if value.length > validationMinlength
, successClass: 'has-success' // Class name on each valid input
@jonasvp
jonasvp / show.html.erb
Last active October 13, 2015 07:27
Integrate Harvest Platform into redmine
<div style="position:absolute;left:1230px;" class="harvest-timer" data-project='{"id":"<%= @project.id %>", "name": "<%=j @project.name %>"}' data-item='{"id": "<%= @issue.id %>", "name":"<%=j @issue.subject %>"'></div>
<script>
(function() {
window._harvestPlatformConfig = {
"applicationName": "Redmine",
"permalink": "https://YOUR.REDMINE.DOMAIN/issues/%ITEM_ID%"
};
var s = document.createElement('script');
s.src = '//platform.harvestapp.com/assets/platform.js';
s.async = true;