Skip to content

Instantly share code, notes, and snippets.

View vphantom's full-sized avatar

Stéphane Lavergne vphantom

View GitHub Profile
@nidico
nidico / issue-migrate-bitbucket-to-github.py
Created September 24, 2012 21:00
Helper script for issue migration from Bitbucket to GitHub
#!/usr/bin/env python
"""
This script helps migrating issues from Bitbucket to GitHub.
It currently ignores milestones completly and doesn't care whether an issue is
open, new or on hold. As long as it's not closed it's considered open.
To use it, install python-bitbucket, PyGithub and ipdb.
@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;
@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
@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
*
@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 <[email protected]>. Copy at will.
@addyosmani
addyosmani / package.json
Last active October 2, 2024 05:38
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",
@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
@ethack
ethack / TypeClipboard.md
Last active October 31, 2024 06:34
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.

@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";
@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