Skip to content

Instantly share code, notes, and snippets.

View pwlin's full-sized avatar
🎧
Listening to Africa by Toto

pwlin pwlin

🎧
Listening to Africa by Toto
View GitHub Profile
// 1: how could you rewrite the following to make it shorter?
foo ? bar.doSomething(el) : bar.doSomethingElse(el);
// 2: what is the faulty logic in the following code?
var foo = 'hello';
(function() {
@smith
smith / screening.js
Created September 29, 2010 15:09 — forked from rmurphey/screening.js
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
@TooTallNate
TooTallNate / notification.js
Created May 6, 2011 00:59
Example of displaying a notification on an iPhone with 'node-iOS'
var iOS = require('iOS');
iOS.createNotification({
header: 'node-iOS Rocks!',
message: 'How much does running \'node\' on your iPhone rock?',
defaultButton: 'A lot!',
alternateButton: 'It rocks my socks'
}, function(err, res){
if (err) throw err;
console.log(res);
@rchrd2
rchrd2 / upload_site.sh
Created April 5, 2016 01:02
Neocities Upload
#!/bin/bash
# Neocities provies an API for uploading files from ./public_html to your site
#
# Example Usage:
# $ USERNAME=username PASS=secret_pass bash upload_site.sh
function upload_file {
fullName=$1
shortName=${fullName:2}
@dhavaln
dhavaln / filesystem.js
Created June 8, 2012 08:51
PhoneGap Filesystem Example
/**
* Prepare the App Folder
*/
(function(){
window.appRootDirName = ".myapp";
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("device is ready");
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.

@darkcolonist
darkcolonist / psvita-vpk-transfer-guide.md
Last active June 16, 2021 13:17
how to transfer VPK via FTP and install them in psvita (henkaku / vitashell)

#how to transfer games to your vita via FTP

###requirements

  • henkaku activated psvita 3.60
  • filezilla ftp client
  • wifi connection
  • make sure your psvita and computer are in the same wifi network

##in your computer

  • install filezilla (ftp client)
@paulrouget
paulrouget / ff.md
Last active November 21, 2021 21:13
Hacking Firefox
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
## A re-spin on http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer, see
## http://community.linuxmint.com/tutorial/view/365
## SHARP-BANG NEXT LINE
#!/bin/sh
# Copyright (c) 2007 Aristotle Pagaltzis
# 2013 Sören Andersen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to