Skip to content

Instantly share code, notes, and snippets.

View gorork's full-sized avatar
🏠
Working from home

gorork

🏠
Working from home
View GitHub Profile
@gorork
gorork / subdomain_for_every_user.js
Created November 24, 2016 08:03
How to reate a sub domain for each user
/**
* dynamic A record
* eg. *.domain.com points to domain.com?
* then in your router
*
* source: https://github.com/bmullan91/express-subdomain/issues/26#issuecomment-225441455
*/
// get your dynamic subdomain
@gorork
gorork / dribbble-profile-usage.html
Created September 21, 2015 00:45
Dribbble Profile widget usage example
<script src="//nadikun.com/code/dribbble-profile/dp-loader.js" data-dribbble-id="rork" async></script>
open -a Google\ Chrome\ Canary --args --disable-web-security

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@gorork
gorork / Gruntfile.js
Last active August 29, 2015 14:21 — forked from jshawl/Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options:{
style:'compressed'
},
files: {
'css/style.css' : 'scss/style.scss'
@gorork
gorork / gist:149b62aeadc7a43d8233
Last active August 29, 2015 14:16
User-friendly validation AngularJS directive
<!--
AngularJS directive
type: AE
1. pass a field name (e.g. "formName.fieldName") into the "messages-for" attribute;
2. pass a scope expression that returns "true" when users tries to submit the given form
-->
<!-- Validate Messages directive starts -->
<div validate-messages messages-for="siteForm.siteName" submitted="submitted"></div>
{
"countries": [
{
"country": "Afghanistan",
"states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"]
},
{
"country": "Albania",
"states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"]
},
@gorork
gorork / gist:6f14b59830193eba18cc
Created December 20, 2014 02:36
Basic package.json
{
"name": "App Name",
"version": "0.0.1",
"homepage": "http://myapp.com",
"repository": {
"type": "git",
"url": "https://github.com/app"
},
"author": {
"name": "Nadi",
@gorork
gorork / gist:92de3a4316c7c00307a5
Last active August 29, 2015 14:11
Gulpfile to compless LESS to CSS using Autoprefixer
// Include Gulp and all required plugins
var gulp = require('gulp');
var less = require('gulp-less');
var autoprefixer = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css');
var gutil = require('gulp-util');
var sourcePath = 'src/custom';
var targetPath = 'assets/css';
@gorork
gorork / gist:cc73bc9a7d118545e9df
Created December 7, 2014 10:16
P2: JavaScript Challenge #3
// Iterate through the localizedRuleNames in ruleResults and
// return an array of their strings.
function ruleList(results) {
var ruleResults = results.formattedResults.ruleResults;
var localizedRuleNamesArray = [];
for (var key in ruleResults) {
// Iterate through object's own properties only