Skip to content

Instantly share code, notes, and snippets.

View egoist's full-sized avatar
🙏
Please support my open-source projects!

EGOIST egoist

🙏
Please support my open-source projects!
View GitHub Profile
@egoist
egoist / gulpfile.coffee
Created March 9, 2015 17:09
An example gulpfile.coffee
gulp = require 'gulp'
coffee = require 'gulp-coffee'
stylus = require 'gulp-stylus'
jade = require 'gulp-jade'
paths =
app: './',
core: './core/*.coffee',
coffee: './assets/coffee/*.coffee',
stylus: './assets/stylus/*.styl',
#lang racket
(define (我是 x n)
(cond
[(zero? n) '()]
[else
(cons x (我是 x (- n 1)))]))
(define 猪头 .)
@egoist
egoist / iambition.html
Last active August 29, 2015 14:18
iambition_contact
<form class="contact-form" action="http://iambition.coding.io/contact/3be865fa-7297-46ff-82c0-46f30085aede" method="POST">
<input type="email" name="from" placeholder="Your email">
<textarea class="content" placeholder="What would you like to say?" rows="5"></textarea>
<button type="submit">Submit</button>
</form>
@egoist
egoist / iambition.js
Last active August 29, 2015 14:18
Ajax post form
$.post('http://iambition.coding.io/contact/3be865fa-7297-46ff-82c0-46f30085aede', {
from: 'from@example.com',
content: 'hello there!'
}, function(data) {
if (data.status == 'good') {
// do something...
}
})
@egoist
egoist / loading-dots.custom.html
Created May 27, 2015 03:11
CSS loading dots config
// for big rounded dots
<div class="loading-dots big-dots"><i></i><i></i><i></i></div>
// for small square dots
<div class="loading-dots"><i></i><i></i><i></i></div>
<style>
.loading-dots i {
background-color: $COLOR; // set dots color
{
"name": "kevin"
}
@egoist
egoist / bg.js
Created June 29, 2015 12:28
trigger when click `star` button
$('body')
.on('click', '.js-toggler-target', function() {
if($(this).attr('aria-label') == 'Star this repository') {
console.log('good');
}
})
@egoist
egoist / opt.js
Created August 10, 2015 14:53
Operator Overloading
var y, words, unspaced, split$ = ''.split, replace$ = ''.replace;
['a', 'b', 'a', 'b'];
['foo', 'bar'].join(', ');
y = 2;
repeatString$('z', y);
words = split$.call(text, ' ');
# when the left one is an array literal
['a' 'b'] * 2 # array repetition
# when the right one is a string literal
<[ foo bar ]> * ', ' # array joining
# or when the left one is a string
y = 2
'z' * y # string repetition
words = text / ' ' # string division
//
my?
#normal
#{[interpolation]}
#flag
//?