Skip to content

Instantly share code, notes, and snippets.

View yangshun's full-sized avatar
😎
Ruining websites since 2013

Yangshun Tay yangshun

😎
Ruining websites since 2013
View GitHub Profile
@mwbrooks
mwbrooks / style.css
Created February 22, 2011 19:34
Remove input field shadow from iOS-Webkit
input[type="text"] {
-webkit-appearance:none; /* Remove default shadow */
border:1px solid black; /* Possibly apply a custom border */
}
@juaxix
juaxix / Bubble.lua
Created February 2, 2012 20:09
Magic Puzzle Bubble in Lua by juaxix ( xixgames )
Bubble = class()
-- Magic Puzzle Bubble by @juaxix - LGPL
-- 11/11/11
-- http://xixgames.com
-- video: http://www.youtube.com/watch?v=rD0fQVSj_7w
-- Bubble states
BUBBLE_EMPTY    = 0
BUBBLE_CREATED  = 1
BUBBLE_FLYING   = 2
BUBBLE_ATTACHED = 3
@jedschneider
jedschneider / gh-pages-tips.md
Created June 7, 2012 17:59
github pages tips for jekyll wiki

Working With Github Pages

The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.

Gitignore

Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.

Working With Code Partials

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 27, 2024 06:33
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@JEG2
JEG2 / fizzbuzz.rb
Created August 1, 2012 21:07
Writing FizzBuzz without modulus division
fizz = [nil, nil, "Fizz"].cycle
buzz = [nil, nil, nil, nil, "Buzz"].cycle
numbers = 1..100
numbers.zip(fizz, buzz) do |n, f, b|
fizzbuzz = [f, b].join
puts(fizzbuzz.empty? ? n : fizzbuzz)
end
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory

Security is Hard

Massive Assignment

  • watch for ActiveRecord Relation, like has_many, has_many :through
  • watch for user_roles, `group_users
  • UPDATE action

Admin

@weitsang
weitsang / nus-fyp-presentation-tips.md
Last active March 4, 2023 00:54
Tips for School of Computing Final Year Project Presentation.

FYP Final Presentation

Basic Principles

  • Show the examiners, and make them understand, clearly what you have achieved after about 400 hours of work over two semesters.
  • Demonstrate to the examiners that you know very well what you have done.
  • Keep the examiners happy.

Slides

@branneman
branneman / better-nodejs-require-paths.md
Last active April 8, 2024 00:22
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

@travisvalentine
travisvalentine / steps.md
Last active June 10, 2023 19:00
Setup Facebook app to test authentication locally (aka, setting up App Domain)

Note: I had issues with setting up my Facebook app so authentication would work. I'd receive the error at the bottom, and it took me a while to figure out what was wrong

Here are the steps I took:

  • Go to http://developers.facebook.com/, create, and setup your app
  • When inside the dashboard, click "Settings"
  • Click "Add Platform"
  • Choose website (for authentication via the web app)
  • Add http://localhost:3000/ as "Site URL" (and "Mobile URL" if necessary)
  • Add localhost to "App Domains" above