Skip to content

Instantly share code, notes, and snippets.

View sidneys's full-sized avatar

sidneys sidneys

  • Germany
View GitHub Profile
@kgn
kgn / gist:1558664
Created January 4, 2012 05:37
Animated NSTableView Scrolling
// Thanks to CuriousKea for getting this started!
// http://stackoverflow.com/a/8480325/239380
- (void)scrollRowToVisible:(NSInteger)rowIndex animate:(BOOL)animate{
if(animate){
NSRect rowRect = [self rectOfRow:rowIndex];
NSPoint scrollOrigin = rowRect.origin;
NSClipView *clipView = (NSClipView *)[self superview];
scrollOrigin.y += MAX(0, round((NSHeight(rowRect)-NSHeight(clipView.frame))*0.5f));
NSScrollView *scrollView = (NSScrollView *)[clipView superview];
@amolk
amolk / remove-rubber-band-web-apps-ios
Last active June 4, 2023 08:38
Remove rubberband scrolling from web apps on mobile safari (iOS)
<!DOCTYPE html>
<html>
<head>
<title>Remove rubberband scrolling from web apps on mobile safari (iOS)</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<style>
html, body {margin: 0; padding: 0; overflow: hidden}
@nickrw
nickrw / volsay.sh
Created April 19, 2013 12:43
volsay: Wrapper around OSX's `say' command, which sets the system volume to the requested level, then restores volume / mute state once speech is complete.
#!/bin/bash
function usage() {
echo "usage: $0 <volume (0-100)> <say args...>"
echo
echo "Unmutes and sets the system volume to volume%, passing the remaining"
echo "arguments to the OSX \`say' command, restoring volume / mute setting"
echo "to previous values after the speech has completed."
exit 1
}
@nicolas-t
nicolas-t / facebook-read-status.user.js
Last active January 17, 2017 03:03
Block facebook's "read status" notification on chat. Your contact won't know if you read his message or not.
// ==UserScript==
// @name Facebook read status
// @description block facebook's "read status" notification on facebook chat.
// @namespace frs
// @include http://www.facebook.com/*
// @include https://www.facebook.com/*
// @grant none
// @version 1
// ==/UserScript==
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@didge
didge / coderesign.sh
Last active September 24, 2022 02:25 — forked from Weptun/floatsign.sh
Script to resign .ipa files with options to change the provisioning file, app name, and bundle id.
#!/bin/bash -x
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
# Extension Copyright (c) 2013 FoundryLogic LLC
# http://foundrylogic.com
#
# Extended by Ronan O Ciosoig January 2012
@blizzy78
blizzy78 / remove-golem-pre-video-ads.js
Last active August 16, 2016 12:05
Remove pre-video ads from golem.de
// ==UserScript==
// @name Remove Golem.de Pre-Video Ads
// @namespace http://blizzy.de/
// @version 1.0
// @description Removes pre-video ads from videos on golem.de
// @match http://*.golem.de/*
// @copyright 2014-2016, Maik Schreiber
// @require //code.jquery.com/jquery-3.1.0.min.js
// @grant none
// ==/UserScript==
@SteveBenner
SteveBenner / macfix4-disable-crash-reporter.rb
Created October 12, 2014 15:34
Mac fix - Disable CrashReporter and prevent it from launching
#!/usr/bin/env ruby
#
# Mac fix 4 - Disable CrashReporter
#
# CrashReporter is a daemon that monitors for crashes and generates a report (duh) when they occur.
# If an application (such as Finder) become stuck in an infinite crash loop, then sometimes it's
# desirable to just turn off CrashReporter entirely, as it will continually generate processes in
# the background which spew errors and logs, resulting in massive overhead to your system resources.
#
# DIAGNOSING:
@RobTrew
RobTrew / JXA_UIToggle.applescript
Created February 24, 2015 13:06
OS X Yosemite Javascript for Applications (JXA): Toggling background, dark mode, and screen color inversion between day ⇄ night settings
function run() {
// Rob Trew 2015
// Ver 0.01
// UI day/night toggling through OS X 10.10 JXA Javascript for Automation
// SWITCH FROM DAY-TIME DARK MENU BAR AND DOCK WITH DARK BACKGROUND
// TO NIGHT-TIME *ALL DARK*
// (TOGGLE MODE AND BACKGROUND TO BRIGHT, THEN INVERT ALL)