Skip to content

Instantly share code, notes, and snippets.

View pketh's full-sized avatar
🐢
https://kinopio.club

Pirijan pketh

🐢
https://kinopio.club
View GitHub Profile
CACHE MANIFEST
#
# Version Control
# v0.0.0 00-00-0000
#
# Handy Dandy Developer Tools
# CHROME chrome://appcache-internals
# FIREFOX about:cache
# Charles - Web Debugging Proxy App
# http://charlesproxy.com
@vasilisvg
vasilisvg / acceptable-retina-images.md
Created July 16, 2012 18:32
Acceptable Retina Images

#Retina images Sharpness is relative. We can only observe if something is really sharp if we can see it next to something that's sharper. Lots of people are looking for solutions for the problem that images look blurry on retina displays. All solutions I've seen so far give the advice to send an image that's twice as wide and twice as high to these new screens. Before you start sending these images, be sure to understand that these files will be four times the size of the smaller version. People with a high end device and a low end connection—everybody in the train in The Netherlands—will hate you.

##Image types I'm generalizing here, but there are two types of images: (1) graphics like logos and (2) photos. Quadroupled images might be justified for the first kind, for logos, icons, things like that. You could also try to find a solution in clever SVG files—with media queries in them, why not? These kinds of ima

@robinsloan
robinsloan / gsub-with-hash.rb
Created October 10, 2013 16:37
Didn't know about this.
def doctorize(string)
string.gsub(/M(iste)?r/, 'Mister' => 'Doctor', 'Mr' => 'Dr')
end
@elijahmanor
elijahmanor / emailPattern.coffee
Created February 8, 2012 05:37
Regular Expressions in CoffeeScript
emailPattern = /// ^ #begin of line
([\w.-]+) #one or more letters, numbers, _ . or -
@ #followed by an @ sign
([\w.-]+) #then one or more letters, numbers, _ . or -
\. #followed by a period
([a-zA-Z.]{2,6}) #followed by 2 to 6 letters or periods
$ ///i #end of line and ignore case
if "john.smith@gmail.com".match emailPattern
console.log "E-mail is valid"
@hasantayyar
hasantayyar / git-dropbox-fix.sh
Created January 9, 2014 10:19
Solution if you are using dropbox and git same time and if you get this error "fatal: Reference has invalid format: refs/heads/master conflicted copy"
find . -type f -name "* conflicted copy*" -exec rm -f {} \;
awk '!/conflicted/' .git/packed-refs > temp && mv temp .git/packed-refs
@njx
njx / remove-widget.html
Created December 18, 2012 23:56
CodeMirror line widget removal bug
<!doctype html>
<html>
<head>
<title>Widget Removal Bug</title>
<link rel="stylesheet" href="lib/codemirror.css">
<script src="lib/codemirror.js"></script>
<link rel="stylesheet" href="doc/docs.css">
<style type="text/css">
.CodeMirror {border: 1px solid black;}
@pketh
pketh / color-cycling.coffee
Last active July 9, 2018 00:04
smooth color cycling backgrounds
target = $('body')
# get random RGB values so we can change background and link colors
r = Math.floor Math.random() * 241
g = Math.floor Math.random() * 241
b = Math.floor Math.random() * 241
# variables to hold the lighter shade RGB values
# rp1; gp1; bp1; rp2; gp2; bp2; rp3; gp3; bp3
@pketh
pketh / bouncy.coffee
Created December 1, 2015 00:32
bouncy links (adapted from shauninman.com/pendium)
# bouncy links
$('a').each ->
$(this).mousemove (e) ->
if this.isAlreadyAnimating
console.log 'still animating: ', this.isAlreadyAnimating
else
baseExpX = 4 # 2 ^ 4 == 16
baseExpY = 2 # 2 ^ 4 == 16
@keithjiff
keithjiff / github_swift_style_guide.md
Created August 7, 2017 21:34
GitHub Swift Style Guide

A guide to our Swift style and conventions.

This is an attempt to encourage patterns that accomplish the following goals (in rough priority order):

  1. Increased rigor, and decreased likelihood of programmer error
  2. Increased clarity of intent
  3. Reduced verbosity
  4. Fewer debates about aesthetics
@holman
holman / emoji_test.rb
Last active June 18, 2020 01:27
A snapshot of the tests we use internally at GitHub to help edit our blog posts before they go out to everybody. For more information, take a peek at http://zachholman.com/posts/how-github-writes-blog-posts
require_relative "test_helper"
require "open-uri"
require "net/http"
class EmojiTest < Blog::Test
def test_no_emoji
posts.each do |post|
content = File.read(post)
refute_match /:[a-zA-Z0-9_]+:/, content,