Skip to content

Instantly share code, notes, and snippets.

Run kiosk mode (full screen mode) in Mac
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --kiosk http://www.google.com
Run kiosk mode (full screen mode) in Windows
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk --kiosk-printing "https://google.com/"
https://superuser.com/questions/716426/running-latest-chrome-for-windows-in-kiosk-mode
@simongcc
simongcc / repeat.js
Created January 7, 2018 09:31 — forked from nathansmith/repeat.js
Handlebars.js helper to generate dummy UI.
/*
Handlebars helper to generate dummy UI.
For instance, a 10x10 table with 100 cells:
<table>
{{#repeat 10}}
<tr>
{{#repeat 10}}
<td>
@simongcc
simongcc / ramdisk.sh
Created October 3, 2017 07:49 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@simongcc
simongcc / migrate-query.sql
Created July 26, 2017 15:04
Migrate wordpress database from one domain to another mainly changing mysql query
#wp db migration query
UPDATE wp_options SET option_value = replace(option_value, 'http://www.livesite.com', 'http://localhost/mysite') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.livesite.com', 'http://localhost/mysite');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.livesite.com', 'http://localhost/mysite');
@simongcc
simongcc / best-localStorage-polyfill-evar.js
Created July 26, 2017 08:10 — forked from juliocesar/best-localStorage-polyfill-evar.js
This is the best localStorage polyfill in the world
// I mean, seriously, localStorage is supported even by your mum. How about instead of
// casing the feature out, you give users in-memory (stale) storage instead?
// If they close your application, they deserve to lose data anyway.
// if (!('localStorage' in window)) {
if (!Modernizr.localstorage) {
window.localStorage = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
@simongcc
simongcc / .gitconfig
Last active March 20, 2019 09:13
Setup OS X git to handle crlf by Windows collaborators correctly
[core]
autocrlf = true
symlinks = true
@simongcc
simongcc / package.sample.json
Created July 16, 2017 03:24
for grunt.sample.js: Grunt sample file running with SASS and Uglify with compass and foundation scss import Raw
{
"name": "",
"version": "0.1.0",
"dependencies": {
"grunt": "^1.0.1"
},
"devDependencies": {
"compass-mixins": "^0.12.10",
"grunt-contrib-uglify": "^3.0.1",
"grunt-contrib-watch": "^1.0.0",
@simongcc
simongcc / grunt.sample.js
Created July 16, 2017 03:23
Grunt sample file running with SASS and Uglify with compass and foundation scss import
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
sass: {
options: {
sourceMap: true,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<!--#include virtual="test.shtml"-->
<!--#echo var="DATE_LOCAL" -->
</body>
// easing function required external library like jQuery.UI
// without 'html', IE will not work
function scrollToElement($ele, duration) {
var duration = duration ? duration : 450,
scrollToPos = $ele ? $ele.position().top : $(document).height() - $(window).height();
$( 'html, body').animate({
scrollTop: scrollToPos
}, duration, 'easingFunction', function() {
// Animation complete.