Skip to content

Instantly share code, notes, and snippets.

View jerone's full-sized avatar

Jeroen van Warmerdam jerone

View GitHub Profile
// ==UserScript==
// @name GreaseMonkey issue #1890
// @namespace https://github.com/greasemonkey/greasemonkey/issues/1890
// @include https://github.com/jerone?tab=activity
// @version 1
// @grant none
// ==/UserScript==
alert('test');
@jerone
jerone / OpenUserJS.org_Export_Cert.user.js
Created March 3, 2014 21:40
OpenUserJS.org Export Cert
// ==UserScript==
// @name OpenUserJS.org Export Cert
// @namespace http://OpenUserJS.org
// @homepageUrl http://OpenUserJS.org
// @include http://userscripts.org/home/scripts
// @version 1
// @grant GM_openInTab
// ==/UserScript==
(function () {
var userId = document.evaluate('//li[@class="menu"]/a[text()[contains(.,"public profile")]]', document, null, 9, null) .singleNodeValue.href.match(/(\d+)/) [0];
@jerone
jerone / ClipboardFusionHelper.cs
Created February 3, 2014 22:47
ClipboardFusion Marco WinForm Test
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Collections.Generic;
public static class ClipboardFusionHelper
{
private static String Truncate(String text, Int32 count=1)
{
if (count > 0 && text.Length > count)
content/addons4-overlay.xul | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/content/addons4-overlay.xul b/content/addons4-overlay.xul
index 8016358..fc55b16 100644
--- a/content/addons4-overlay.xul
+++ b/content/addons4-overlay.xul
@@ -45,18 +45,24 @@
label="&Show;" accesskey="&Show.accesskey;" class="greasemonkey greasemonkeyNoHide"
/>
@jerone
jerone / BrokerController.cs
Created March 28, 2013 08:16
CheckBox List in MVC C# ASP.NET
// GET: /Brokers/Edit/5
public ActionResult Edit(Guid id)
{
Broker broker = db.Brokers.Find(id);
if (broker == null)
{
return HttpNotFound();
}
ViewBag.BrokerValues = GetBrokerValues(broker);
@jerone
jerone / gist:4612335
Last active December 11, 2015 14:09
C# float differences
/// C# float differences:
-3.40282347E+38 // float.MinValue
-3.402823E+38 // database
float.MinValue == float.Parse(float.MinValue.ToString()) // false
float.MinValue == Convert.ToSingle(float.MinValue) // true
@jerone
jerone / aero.cmd
Created January 23, 2013 19:56
Restart Windows Aero
net stop uxsms
net start uxsms
@jerone
jerone / gist:4595989
Created January 22, 2013 16:22
Insert char at index in char array (in this case a number)
using System;
using System.Windows.Forms;
namespace Script
{
public class Script
{
public void Main()
{
int no = 52123456;
@jerone
jerone / menu.js
Created November 30, 2012 14:20 — forked from macdonst/menu.js
Cordova OptionsMenu example
var optionsmenu = new OptionsMenu({
id: "optionsmenu",
items: [
{
label: "Settings",
image: "menu/settings.png",
action: onSettings
},
{
label: "Help",
@jerone
jerone / has3d.js
Created October 1, 2012 08:26 — forked from lorenzopolidori/has3d.js
Testing for CSS 3D Transforms Support
function has3D() {
var has3D,
el = document.createElement("p"),
transforms = {
'WebkitTransform': '-webkit-transform',
'OTransform': '-o-transform',
'MSTransform': '-ms-transform',
'MozTransform': '-moz-transform',
'Transform': 'transform'
};