Skip to content

Instantly share code, notes, and snippets.

View yckart's full-sized avatar

Yannick Albert yckart

View GitHub Profile
@wintercn
wintercn / pylexer.html
Created September 24, 2013 15:02
python词法分析
<body>
<style>
.number {
color:purple;
}
.keyword {
color:blue;
}
.string {
@BonsaiDen
BonsaiDen / box.js
Last active February 16, 2022 20:35
Simple physics engine optimized for oldschool platformers. Feel free to integrate the missing pieces to support circles and arbitrary polygons.
/**
* Copyright (c) 2013 Ivo Wetzel.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@stowball
stowball / nth-child-examples.scss
Last active December 18, 2015 01:29
Poor man's nth-child mixin for LT IE9. It supports single (X), repeating (Xn), repeating starting from an index (Xn+Y / Xn-Y) and odd & even. View a live demo here: http://codepen.io/stowball/pen/GxlIc
.selected {
background: #000;
color: #fff;
}
.even > li:first-child {
@include nth-child(even, 'li') {
@extend .selected;
}
}
@konitter
konitter / frontend-tools.md
Last active September 29, 2019 11:32 — forked from gaspanik/kkmsz20130417.mdown
Frontend Tools

Articles, Styletiles & Styleguide

Frameworks

@BonsaiDen
BonsaiDen / lexer.js
Created April 29, 2013 19:43
Emblem Lexer
var rules = require('./rules');
// Emblem Lexer ---------------------------------------------------------------
// ----------------------------------------------------------------------------
var Lexer = function() {
this.line = 0;
this.col = 0;
this.offset = 0;
@kpdecker
kpdecker / check-image.sh
Created April 12, 2013 21:23
Prototype png color reduction script/linter
#! /bin/sh
QUALITY=95
DEPTHS="256 128 64 32 8 4 2"
totalSaved=0
for name in `find "$1" -name "*.png" -not -name "*-fs8.png"`; do
output=
@barneycarroll
barneycarroll / jquery.getLines.js
Last active December 29, 2015 02:51
Count the number of lines of text in a given element.
void function $getLines($){
function countLines($element){
var lines = 0;
var greatestOffset = void 0;
$element.find('character').each(function(){
if(!greatestOffset || this.offsetTop > greatestOffset){
greatestOffset = this.offsetTop;
++lines;
}
@ZeeAgency
ZeeAgency / gist:5249740
Last active December 15, 2015 10:59
Different "pointing" unicode characters
Black pointing triangles
White pointing triangles
module.exports = function(redisClient,prefix) {
var Autocomplete = {};
Autocomplete.prefix = prefix;
Autocomplete.terminal = "+";
Autocomplete.add = function(word, next) {
function add(letters, key, last, x) {
var letter = last ? Autocomplete.terminal : letters[x];
var score = last ? 0 : letter.charCodeAt(0);
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else